{
 "cells": [
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Named Entity Recognition NER using spaCy - Extracting Subject Verb Action\n",
    "\n",
    "## [Link to my Youtube Video Explaining this whole Notebook](https://www.youtube.com/watch?v=TxTxWAohW7E&list=PLxqBkZuBynVTn2lkHNAcw6lgm1MD5QiMK&index=5)\n",
    "\n",
    "[![Imgur](https://imgur.com/s0Oc4p5.png)](https://www.youtube.com/watch?v=TxTxWAohW7E&list=PLxqBkZuBynVTn2lkHNAcw6lgm1MD5QiMK&index=5)"
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## First What is BERT?\n",
    "\n",
    "BERT stands for Bidirectional Encoder Representations from Transformers. The name itself gives us several clues to what BERT is all about.\n",
    "\n",
    "BERT architecture consists of several Transformer encoders stacked together. Each Transformer encoder encapsulates two sub-layers: a self-attention layer and a feed-forward layer.\n",
    "\n",
    "### There are two different BERT models:\n",
    "\n",
    "- BERT base, which is a BERT model consists of 12 layers of Transformer encoder, 12 attention heads, 768 hidden size, and 110M parameters.\n",
    "\n",
    "- BERT large, which is a BERT model consists of 24 layers of Transformer encoder,16 attention heads, 1024 hidden size, and 340 parameters.\n",
    "\n",
    "\n",
    "\n",
    "BERT Input and Output\n",
    "BERT model expects a sequence of tokens (words) as an input. In each sequence of tokens, there are two special tokens that BERT would expect as an input:\n",
    "\n",
    "- [CLS]: This is the first token of every sequence, which stands for classification token.\n",
    "- [SEP]: This is the token that makes BERT know which token belongs to which sequence. This special token is mainly important for a next sentence prediction task or question-answering task. If we only have one sequence, then this token will be appended to the end of the sequence.\n",
    "\n",
    "\n",
    "It is also important to note that the maximum size of tokens that can be fed into BERT model is 512. If the tokens in a sequence are less than 512, we can use padding to fill the unused token slots with [PAD] token. If the tokens in a sequence are longer than 512, then we need to do a truncation.\n",
    "\n",
    "And that’s all that BERT expects as input.\n",
    "\n",
    "BERT model then will output an embedding vector of size 768 in each of the tokens. We can use these vectors as an input for different kinds of NLP applications, whether it is text classification, next sentence prediction, Named-Entity-Recognition (NER), or question-answering.\n",
    "\n",
    "\n",
    "------------\n",
    "\n",
    "**For a text classification task**, we focus our attention on the embedding vector output from the special [CLS] token. This means that we’re going to use the embedding vector of size 768 from [CLS] token as an input for our classifier, which then will output a vector of size the number of classes in our classification task.\n",
    "\n",
    "-----------------------\n",
    "\n",
    "![Imgur](https://imgur.com/NpeB9vb.png)\n",
    "\n",
    "-------------------------"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "ROOT_DIR = '../../input/' # Local Machine\n",
    "\n",
    "# ROOT_DIR = '../input/all-the-news/' # Kaggle\n",
    "\n",
    "\n",
    "# print(os.listdir('../input/all-the-news/'))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "\n",
    "# path = \"all-the-news/\"\n",
    "df = pd.read_csv(ROOT_DIR + \"articles1.csv\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(50000, 10)"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Unnamed: 0</th>\n",
       "      <th>id</th>\n",
       "      <th>title</th>\n",
       "      <th>publication</th>\n",
       "      <th>author</th>\n",
       "      <th>date</th>\n",
       "      <th>year</th>\n",
       "      <th>month</th>\n",
       "      <th>url</th>\n",
       "      <th>content</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0</td>\n",
       "      <td>17283</td>\n",
       "      <td>House Republicans Fret About Winning Their Hea...</td>\n",
       "      <td>New York Times</td>\n",
       "      <td>Carl Hulse</td>\n",
       "      <td>2016-12-31</td>\n",
       "      <td>2016.0</td>\n",
       "      <td>12.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>WASHINGTON  —   Congressional Republicans have...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1</td>\n",
       "      <td>17284</td>\n",
       "      <td>Rift Between Officers and Residents as Killing...</td>\n",
       "      <td>New York Times</td>\n",
       "      <td>Benjamin Mueller and Al Baker</td>\n",
       "      <td>2017-06-19</td>\n",
       "      <td>2017.0</td>\n",
       "      <td>6.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>After the bullet shells get counted, the blood...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>2</td>\n",
       "      <td>17285</td>\n",
       "      <td>Tyrus Wong, ‘Bambi’ Artist Thwarted by Racial ...</td>\n",
       "      <td>New York Times</td>\n",
       "      <td>Margalit Fox</td>\n",
       "      <td>2017-01-06</td>\n",
       "      <td>2017.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>When Walt Disney’s “Bambi” opened in 1942, cri...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>3</td>\n",
       "      <td>17286</td>\n",
       "      <td>Among Deaths in 2016, a Heavy Toll in Pop Musi...</td>\n",
       "      <td>New York Times</td>\n",
       "      <td>William McDonald</td>\n",
       "      <td>2017-04-10</td>\n",
       "      <td>2017.0</td>\n",
       "      <td>4.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Death may be the great equalizer, but it isn’t...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>4</td>\n",
       "      <td>17287</td>\n",
       "      <td>Kim Jong-un Says North Korea Is Preparing to T...</td>\n",
       "      <td>New York Times</td>\n",
       "      <td>Choe Sang-Hun</td>\n",
       "      <td>2017-01-02</td>\n",
       "      <td>2017.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>SEOUL, South Korea  —   North Korea’s leader, ...</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   Unnamed: 0     id                                              title  \\\n",
       "0           0  17283  House Republicans Fret About Winning Their Hea...   \n",
       "1           1  17284  Rift Between Officers and Residents as Killing...   \n",
       "2           2  17285  Tyrus Wong, ‘Bambi’ Artist Thwarted by Racial ...   \n",
       "3           3  17286  Among Deaths in 2016, a Heavy Toll in Pop Musi...   \n",
       "4           4  17287  Kim Jong-un Says North Korea Is Preparing to T...   \n",
       "\n",
       "      publication                         author        date    year  month  \\\n",
       "0  New York Times                     Carl Hulse  2016-12-31  2016.0   12.0   \n",
       "1  New York Times  Benjamin Mueller and Al Baker  2017-06-19  2017.0    6.0   \n",
       "2  New York Times                   Margalit Fox  2017-01-06  2017.0    1.0   \n",
       "3  New York Times               William McDonald  2017-04-10  2017.0    4.0   \n",
       "4  New York Times                  Choe Sang-Hun  2017-01-02  2017.0    1.0   \n",
       "\n",
       "   url                                            content  \n",
       "0  NaN  WASHINGTON  —   Congressional Republicans have...  \n",
       "1  NaN  After the bullet shells get counted, the blood...  \n",
       "2  NaN  When Walt Disney’s “Bambi” opened in 1942, cri...  \n",
       "3  NaN  Death may be the great equalizer, but it isn’t...  \n",
       "4  NaN  SEOUL, South Korea  —   North Korea’s leader, ...  "
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "['New York Times' 'Breitbart' 'CNN' 'Business Insider' 'Atlantic']\n"
     ]
    }
   ],
   "source": [
    "sources = df[\"publication\"].unique()\n",
    "print(sources)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(100,)"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "condition = df[\"publication\"].isin([\"New York Times\"])\n",
    "\n",
    "content_df = df.loc[condition, :][\"content\"][:100]\n",
    "\n",
    "content_df.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0    WASHINGTON  —   Congressional Republicans have...\n",
       "1    After the bullet shells get counted, the blood...\n",
       "2    When Walt Disney’s “Bambi” opened in 1942, cri...\n",
       "3    Death may be the great equalizer, but it isn’t...\n",
       "4    SEOUL, South Korea  —   North Korea’s leader, ...\n",
       "Name: content, dtype: object"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "content_df.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "for article in content_df[:2]:\n",
    "    print(article)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/usr/lib/python3/dist-packages/requests/__init__.py:89: RequestsDependencyWarning: urllib3 (1.26.6) or chardet (3.0.4) doesn't match a supported version!\n",
      "  warnings.warn(\"urllib3 ({}) or chardet ({}) doesn't match a supported \"\n",
      "/home/paul/.local/lib/python3.9/site-packages/spacy/util.py:837: UserWarning: [W095] Model 'en_core_web_sm' (3.2.0) was trained with spaCy v3.2 and may not be 100% compatible with the current version (3.3.1). If you see errors or degraded performance, download a newer compatible model or retrain your custom model with the current spaCy version. For more details and available updates, run: python -m spacy validate\n",
      "  warnings.warn(warn_msg)\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "He he PRON PRP nsubj Xx True True\n",
      "would would AUX MD aux xxxx True True\n",
      "not not PART RB neg xxx True True\n",
      "tell tell VERB VB ROOT xxxx True False\n",
      "the the DET DT det xxx True True\n",
      "police police NOUN NNS dobj xxxx True False\n",
      "what what PRON WP dobj xxxx True True\n",
      "he he PRON PRP nsubj xx True True\n",
      "had have AUX VBD aux xxx True True\n",
      "learned learn VERB VBN ccomp xxxx True False\n"
     ]
    }
   ],
   "source": [
    "import spacy\n",
    "\n",
    "nlp = spacy.load('en_core_web_sm')\n",
    "\n",
    "text = \"He would not tell the police what he had learned\"\n",
    "\n",
    "doc = nlp(text)\n",
    "\n",
    "for token in doc:\n",
    "    print(token.text, token.lemma_, token.pos_, token.tag_, token.dep_, token.shape_, token.is_alpha, token.is_stop  )"
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### In below the named_entities variable should show me a dict structure like below\n",
    "\n",
    "```\n",
    "{\n",
    "'GPE': {'WASHINGTON': 1,\n",
    "    'Obama': 1,\n",
    "    'the District of Columbia Circuit': 1,\n",
    "    'Manhattan': 13,\n",
    "    'New York City': 3,\n",
    "    'Bronx': 19 },\n",
    "\n",
    "'NORP': {'Republicans': 15,\n",
    "    'Americans': 1,\n",
    "    'Republican': 2,\n",
    "    'Hispanic': 1,}\n",
    "```"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [],
   "source": [
    "def return_entities_and_processed_docs(data_frame):\n",
    "    \"\"\"\n",
    "    Extracts named entities from a DataFrame and returns them along with the processed docs.\n",
    "\n",
    "    Args:\n",
    "        data_frame (DataFrame): The DataFrame from which to extract named entities.\n",
    "\n",
    "    Returns:\n",
    "        dict: A dictionary mapping entity types to a dictionary of entity names to counts.\n",
    "        list: A list of processed docs.\n",
    "    \"\"\"\n",
    "    # Initialize the dictionary to hold named entities\n",
    "    named_entities = {}\n",
    "    # Initialize the list to hold processed docs\n",
    "    processed_docs = []\n",
    "    \n",
    "    # Process each item in the DataFrame\n",
    "    for item in data_frame:\n",
    "        # Process the item with a language model\n",
    "        doc = nlp(item)\n",
    "        # Add the processed doc to the list\n",
    "        processed_docs.append(doc)\n",
    "        \n",
    "        # For each named entity in the doc...\n",
    "        for ent in doc.ents:\n",
    "            # Extract the entity text (e.g., 'WASHINGTON')\n",
    "            entity_text = ent.text\n",
    "            # Extract the entity type (e.g., 'GPE')\n",
    "            entity_type = str(ent.label_)\n",
    "            # Initialize a dictionary to hold the current entities\n",
    "            current_ents = {}\n",
    "            \n",
    "            # If the entity type is already in the named entities dictionary...\n",
    "            if entity_type in named_entities.keys():\n",
    "                # Get the dictionary of entity names to counts\n",
    "                current_ents = named_entities.get(entity_type)\n",
    "                \n",
    "            # Increment the count for the entity name\n",
    "            # This will add 1 to the count in the inner dictionary\n",
    "            current_ents[entity_text] = current_ents.get(entity_text, 0) + 1\n",
    "            \n",
    "            # Update the inner dictionary for the entity type\n",
    "            named_entities[entity_type] = current_ents\n",
    "\n",
    "    # Return the named entities and the processed docs\n",
    "    return named_entities, processed_docs\n",
    "\n",
    "\n",
    "named_entities, processed_docs = return_entities_and_processed_docs(content_df)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'GPE': {'WASHINGTON': 18,\n",
       "  'Obama': 2,\n",
       "  'the District of Columbia Circuit': 1,\n",
       "  'Manhattan': 30,\n",
       "  'New York City': 13,\n",
       "  'Bronx': 26,\n",
       "  'Upper Manhattan': 2,\n",
       "  'Lower Manhattan': 2,\n",
       "  'the United States': 81,\n",
       "  'St. Mary’s Park': 1,\n",
       "  'New York': 38,\n",
       "  'Mott Haven': 1,\n",
       "  'Brooklyn': 18,\n",
       "  'Queens': 10,\n",
       "  'Staten Island': 4,\n",
       "  'Washington Heights': 1,\n",
       "  'Gramercy Park': 1,\n",
       "  'the City of New York': 1,\n",
       "  'America': 31,\n",
       "  'Hollywood': 7,\n",
       "  'California': 21,\n",
       "  'San Francisco': 7,\n",
       "  'San Francisco Bay': 1,\n",
       "  'Angel Island': 2,\n",
       "  'Guangdong Province': 1,\n",
       "  'United States': 20,\n",
       "  'Attuned': 1,\n",
       "  'Sacramento': 2,\n",
       "  'Los Angeles': 10,\n",
       "  'Pasadena': 1,\n",
       "  'Sunland': 2,\n",
       "  'Calif.': 11,\n",
       "  'Minneapolis': 3,\n",
       "  'Eagles': 1,\n",
       "  'Saskatchewan': 1,\n",
       "  'Tennessee': 4,\n",
       "  'New York Giant': 1,\n",
       "  'Texas': 6,\n",
       "  'Waco': 1,\n",
       "  'Tex.': 4,\n",
       "  'Rwanda': 1,\n",
       "  'Bosnia': 1,\n",
       "  'Israel': 16,\n",
       "  'Poland': 1,\n",
       "  'Vera Rubin': 1,\n",
       "  'SEOUL': 1,\n",
       "  'South Korea': 7,\n",
       "  'North Korea’s': 2,\n",
       "  'North Korea': 13,\n",
       "  'Cheong': 1,\n",
       "  'Rodong': 1,\n",
       "  'Japan': 5,\n",
       "  'Guam': 1,\n",
       "  'LONDON': 2,\n",
       "  'Norfolk': 1,\n",
       "  'England': 4,\n",
       "  'Thailand': 1,\n",
       "  'Britain': 5,\n",
       "  'Taiwan': 13,\n",
       "  'China': 61,\n",
       "  'Beijing': 15,\n",
       "  'Taipei': 1,\n",
       "  'The United States': 6,\n",
       "  'Washington': 48,\n",
       "  'Houston': 6,\n",
       "  'Versailles': 1,\n",
       "  'Ky.': 2,\n",
       "  'Charlotte': 2,\n",
       "  'Laconia, N. H.': 1,\n",
       "  'Williamsburg': 1,\n",
       "  'Va.': 2,\n",
       "  'Starz': 1,\n",
       "  'La Jolla': 1,\n",
       "  'San Diego': 1,\n",
       "  'Polihale Beach': 1,\n",
       "  'Kauai': 1,\n",
       "  'Hawaii': 3,\n",
       "  'Palm Springs': 2,\n",
       "  'New Hampshire': 1,\n",
       "  'Puerto Rico': 2,\n",
       "  'New York State': 2,\n",
       "  'Ohio': 4,\n",
       "  'Iowa': 5,\n",
       "  'Paris': 11,\n",
       "  'North Dakota': 1,\n",
       "  'Rhode Island': 1,\n",
       "  'La Porte': 1,\n",
       "  'WEST PALM BEACH': 1,\n",
       "  'Fla.': 2,\n",
       "  'Palm Beach': 3,\n",
       "  'Crawford': 1,\n",
       "  'Kennebunkport': 1,\n",
       "  'Florida': 6,\n",
       "  'Midtown Manhattan': 2,\n",
       "  'Ireland': 3,\n",
       "  'Mexico': 21,\n",
       "  'Melania': 2,\n",
       "  'Maryland': 2,\n",
       "  'Adorama': 1,\n",
       "  'Zoomin': 1,\n",
       "  'PhotoBarn': 3,\n",
       "  'Tokyo': 4,\n",
       "  'Irvine': 1,\n",
       "  'Minn.': 1,\n",
       "  'New York’s': 2,\n",
       "  'Boston': 2,\n",
       "  'Sumana': 1,\n",
       "  'Harihareswara': 1,\n",
       "  'Astoria': 1,\n",
       "  'East Harlem': 1,\n",
       "  'Braithophone': 1,\n",
       "  'Charleston': 4,\n",
       "  'Indiana': 5,\n",
       "  'Faretta': 1,\n",
       "  'India': 10,\n",
       "  'New Delhi': 4,\n",
       "  'Gujarat': 1,\n",
       "  'East Delhi': 1,\n",
       "  'Baghdad': 5,\n",
       "  'France': 13,\n",
       "  'Iraq': 28,\n",
       "  'ISIL': 2,\n",
       "  'Mosul': 3,\n",
       "  'Sadr City': 1,\n",
       "  'Moktada': 1,\n",
       "  'The United States State Department': 1,\n",
       "  'Syria': 24,\n",
       "  'SYDNEY': 1,\n",
       "  'Australia': 2,\n",
       "  'Melbourne': 2,\n",
       "  'Victoria': 1,\n",
       "  'Port Phillip': 1,\n",
       "  'Detroit': 2,\n",
       "  'the N. F. C. East': 1,\n",
       "  'Dallas': 5,\n",
       "  'Atlanta': 4,\n",
       "  'the N. F. C.': 3,\n",
       "  'Oakland': 2,\n",
       "  'Miami': 7,\n",
       "  'Pittsburgh': 2,\n",
       "  'Kansas City': 1,\n",
       "  'Philadelphia': 5,\n",
       "  'New Orleans': 1,\n",
       "  'Indianapolis': 3,\n",
       "  'Stella Bulochnikov': 1,\n",
       "  'Grammys': 1,\n",
       "  'PARIS': 2,\n",
       "  'Iconem': 1,\n",
       "  'Khorsabad': 1,\n",
       "  'Damascus': 8,\n",
       "  'Yemen': 1,\n",
       "  'Mesopotamia': 1,\n",
       "  'London': 10,\n",
       "  'Tatjana': 2,\n",
       "  'Cindy': 1,\n",
       "  'Wham': 1,\n",
       "  'Boy Bar': 1,\n",
       "  'Kentucky': 3,\n",
       "  'Wisconsin': 1,\n",
       "  'Alabama': 3,\n",
       "  'Russia': 50,\n",
       "  'Oklahoma': 2,\n",
       "  'Colorado': 2,\n",
       "  'Istanbul': 8,\n",
       "  'Turkey': 40,\n",
       "  'South Korea’s': 1,\n",
       "  'Denmark': 4,\n",
       "  'Delhi': 1,\n",
       "  'Mogadishu': 1,\n",
       "  'Somalia': 1,\n",
       "  'Brazil': 4,\n",
       "  'Pakistan': 5,\n",
       "  'Sichuan Province': 2,\n",
       "  'Yan’an': 1,\n",
       "  'Myanmar': 1,\n",
       "  'Germany': 8,\n",
       "  'Connecticut': 1,\n",
       "  'the United States Central Command': 1,\n",
       "  'Vietnam': 3,\n",
       "  'Vietcong': 1,\n",
       "  'Survival': 1,\n",
       "  'Korea': 1,\n",
       "  'Afghanistan': 42,\n",
       "  'Cuba': 1,\n",
       "  'Kyrgyzstan': 3,\n",
       "  'Interfax': 1,\n",
       "  'Ankara': 1,\n",
       "  'Libya': 1,\n",
       "  'Illinois': 4,\n",
       "  'Chicago': 5,\n",
       "  'Nuristan': 1,\n",
       "  'Kabul': 4,\n",
       "  'Kandahar': 2,\n",
       "  'Karzai': 1,\n",
       "  'Kunduz': 1,\n",
       "  'Bagram': 1,\n",
       "  'North Africa': 1,\n",
       "  'West Point': 1,\n",
       "  'Warsaw': 1,\n",
       "  'Aunt Joan': 1,\n",
       "  'West Bank': 3,\n",
       "  'East Jerusalem': 1,\n",
       "  'Italy': 7,\n",
       "  'Cancun': 1,\n",
       "  'Calgary': 1,\n",
       "  'Alberta': 2,\n",
       "  'Canada': 13,\n",
       "  'Toronto': 3,\n",
       "  'Slovenia': 2,\n",
       "  'São Paulo': 2,\n",
       "  'Sérgio Fontes': 1,\n",
       "  'Manaus as': 1,\n",
       "  'the United States Air Force': 1,\n",
       "  'Hawthorne': 1,\n",
       "  'New Jersey': 7,\n",
       "  'Livingston': 1,\n",
       "  'Paramus': 1,\n",
       "  'Midwood': 1,\n",
       "  'Long Island': 1,\n",
       "  'Pennsylvania': 2,\n",
       "  'Jordan': 1,\n",
       "  'Mamaroneck': 1,\n",
       "  'Claremont': 1,\n",
       "  'Alaska': 3,\n",
       "  'Berkeley': 1,\n",
       "  'Mindanao': 1,\n",
       "  'Philippines': 7,\n",
       "  'Elmhurst': 2,\n",
       "  'the Filipino Consulate': 1,\n",
       "  'Neediest Cases': 1,\n",
       "  'Virginia': 2,\n",
       "  'South Carolina': 3,\n",
       "  'New Mexico': 1,\n",
       "  'North Carolina': 3,\n",
       "  'Azerbaijan': 1,\n",
       "  'Michigan': 5,\n",
       "  'Hell': 1,\n",
       "  'Mich.': 3,\n",
       "  'Wyoming': 2,\n",
       "  'Flat Rock': 1,\n",
       "  'Utah': 1,\n",
       "  'Coahuila': 1,\n",
       "  'Arizona': 3,\n",
       "  'Flint': 1,\n",
       "  'Vermont': 3,\n",
       "  'San Bernardino': 2,\n",
       "  'LOS ANGELES': 1,\n",
       "  'Hebron': 3,\n",
       "  'Tel Aviv': 1,\n",
       "  'Azaria': 1,\n",
       "  'Murdochs': 3,\n",
       "  'Shanghai': 1,\n",
       "  'the Faroe Islands': 1,\n",
       "  'Henan Province': 1,\n",
       "  'Cisco': 1,\n",
       "  '’s': 1,\n",
       "  'Panzhihua': 2,\n",
       "  'Montauk': 1,\n",
       "  'Rockport': 1,\n",
       "  'Mass.': 2,\n",
       "  'Bay Ridge': 1,\n",
       "  'Melina': 1,\n",
       "  'Somerville': 1,\n",
       "  'Portsmouth': 1,\n",
       "  'Rafael': 2,\n",
       "  'Neediest': 1,\n",
       "  'Georgia': 3,\n",
       "  'Oregon': 1,\n",
       "  'West Virginia': 1,\n",
       "  'the District of Columbia': 1,\n",
       "  'Tracy': 1,\n",
       "  'Belmont': 1,\n",
       "  'Riga': 1,\n",
       "  'Latvia': 1,\n",
       "  'Moscow': 4,\n",
       "  'Soho Rooms': 1,\n",
       "  'Kiev': 1,\n",
       "  'Ukraine': 8,\n",
       "  'Alibaba': 1,\n",
       "  'New York City bar association': 1,\n",
       "  'CHARLESTON': 1,\n",
       "  'Charleston County': 1,\n",
       "  'Seattle': 1,\n",
       "  'Uzbekistan': 2,\n",
       "  'stymie': 1,\n",
       "  'the Ottoman Empire': 1,\n",
       "  'Lebanon': 2,\n",
       "  'Geneva': 2,\n",
       "  'Astana': 1,\n",
       "  'Kazakhstan': 1,\n",
       "  'Hong Kong': 3,\n",
       "  'British Columbia': 3,\n",
       "  'Vancouver Island': 3,\n",
       "  'Port Hardy': 1,\n",
       "  'Kwakiutl': 2,\n",
       "  'Vancouver Island’s': 1,\n",
       "  'Kingston': 3,\n",
       "  'Ottawa': 4,\n",
       "  'Burbank': 1,\n",
       "  'Whitehorse': 1,\n",
       "  'Dawson City': 1,\n",
       "  'Dawson': 1,\n",
       "  'Prussia': 1,\n",
       "  'Niagara': 2,\n",
       "  'Ontario': 1,\n",
       "  'Avondale Dairy': 1,\n",
       "  'Herman Melville': 1,\n",
       "  'Quebec': 2,\n",
       "  'Mystic': 1,\n",
       "  'j’avais': 1,\n",
       "  'Memphrémagog': 1,\n",
       "  'Montreal': 2,\n",
       "  'Tofino': 1,\n",
       "  'Berlin': 1,\n",
       "  'Milwaukee': 1,\n",
       "  'Monterey': 1,\n",
       "  'Mustique': 1,\n",
       "  'San   ': 1,\n",
       "  'Austria': 1,\n",
       "  'Vienna': 2,\n",
       "  'Salzburg': 1,\n",
       "  'Hamburg': 1,\n",
       "  'West Palm Beach': 1,\n",
       "  'Orlando': 2,\n",
       "  'Central Fare': 1,\n",
       "  'Switzerland': 1,\n",
       "  'Zurich': 1,\n",
       "  'Rhine': 1,\n",
       "  'the Northwest Territories': 1,\n",
       "  'Falsettos': 1,\n",
       "  'Ruben': 1,\n",
       "  'Glocca': 1,\n",
       "  'Highwaymen': 1,\n",
       "  'Mag': 1,\n",
       "  'New York City’s': 2,\n",
       "  'Puebla city': 1,\n",
       "  'Mexico City': 1,\n",
       "  'Puebla state': 1,\n",
       "  'Puebla': 4,\n",
       "  'the R. C. S.': 2,\n",
       "  'Colombia': 1,\n",
       "  'Honduras': 1,\n",
       "  'Ethiopia': 2,\n",
       "  'Bahrain': 3,\n",
       "  'Morocco': 3,\n",
       "  'Egypt': 3,\n",
       "  'Saudi Arabia': 1,\n",
       "  'Sudan': 5,\n",
       "  'United   ': 1,\n",
       "  'Reddit': 1,\n",
       "  'P4ssword': 1,\n",
       "  'Ecuador': 1,\n",
       "  'the R. C. S. Three': 1,\n",
       "  'Quito': 1,\n",
       "  'Milan': 3,\n",
       "  'Transylvania': 1,\n",
       "  'Iran': 4,\n",
       "  'Madrid': 1,\n",
       "  'Singapore': 1,\n",
       "  'the United Arab Emirates': 1,\n",
       "  'Alexandria': 1,\n",
       "  'Amsterdam': 1,\n",
       "  'Jalisco': 1,\n",
       "  'Moreno Valle’s': 1,\n",
       "  'Reston': 1,\n",
       "  'Fort Lauderdale': 1,\n",
       "  'Montana': 2,\n",
       "  'Baltimore': 1,\n",
       "  'Cincinnati': 1,\n",
       "  'St. Clair': 1,\n",
       "  'Mo.': 1,\n",
       "  'Inez': 1,\n",
       "  'Foxconn': 1,\n",
       "  '0': 1,\n",
       "  'Haiti': 1,\n",
       "  'West Africa': 1,\n",
       "  'Kidapawan City': 1,\n",
       "  'Manila': 1,\n",
       "  'Las Vegas': 1,\n",
       "  'Southampton': 1,\n",
       "  'Wiltshire': 1,\n",
       "  'Belfast': 1,\n",
       "  'Apulia': 2,\n",
       "  'Penelope': 3,\n",
       "  'Echo Park': 1,\n",
       "  'Netflix': 1,\n",
       "  'Horst': 1,\n",
       "  'Missouri': 1,\n",
       "  'Arkansas': 1,\n",
       "  'Maine': 1,\n",
       "  'Fort Wayne': 1,\n",
       "  'Ind.': 1,\n",
       "  'the D. N. C. ’s': 1,\n",
       "  'Estonia': 1,\n",
       "  'Illuminati': 1,\n",
       "  'Cleveland': 1,\n",
       "  'Hangzhou': 1,\n",
       "  'Gambia': 1,\n",
       "  'Argentina': 3,\n",
       "  'Tunisia': 2,\n",
       "  'Bolivia': 1,\n",
       "  'Uganda': 2,\n",
       "  'Lima': 1,\n",
       "  'Peru': 1,\n",
       "  'Costa Rica': 1,\n",
       "  'the Czech Republic': 1,\n",
       "  'Prague': 1,\n",
       "  'Brussels': 1,\n",
       "  'Belgium': 1,\n",
       "  'Algeria': 1,\n",
       "  'Finland': 1,\n",
       "  'Ala.': 1,\n",
       "  'the United States of America': 1,\n",
       "  'Birmingham': 2,\n",
       "  'Mobile': 1,\n",
       "  'Kenmore': 1,\n",
       "  'New Jersey Transit': 1,\n",
       "  'Hoboken': 1,\n",
       "  'DETROIT': 1,\n",
       "  'Silverado': 1,\n",
       "  'Rochester': 1,\n",
       "  'Johnson City': 1,\n",
       "  'Binghamton': 1,\n",
       "  'Wayne': 1},\n",
       " 'NORP': {'Republicans': 138,\n",
       "  'Americans': 26,\n",
       "  'Republican': 67,\n",
       "  'Hispanic': 3,\n",
       "  'Chinese': 48,\n",
       "  'scan': 3,\n",
       "  'Modernist': 1,\n",
       "  'Asian': 1,\n",
       "  'Asians': 1,\n",
       "  'Austrian': 1,\n",
       "  'Japanese': 3,\n",
       "  'American': 136,\n",
       "  'Cuban': 2,\n",
       "  'Egyptian': 4,\n",
       "  'French': 17,\n",
       "  'Iranian': 2,\n",
       "  'Nazis': 1,\n",
       "  'Communists': 1,\n",
       "  'Latin': 2,\n",
       "  'Dutch': 1,\n",
       "  'Nazi': 1,\n",
       "  'South Korean': 1,\n",
       "  'Taiwanese': 1,\n",
       "  'obese': 2,\n",
       "  'Nico': 1,\n",
       "  'German': 6,\n",
       "  'Manish': 1,\n",
       "  'Mazzy Star': 1,\n",
       "  'Hawaiian': 1,\n",
       "  'Roman Catholic': 1,\n",
       "  'Catholic': 2,\n",
       "  'Norwegian': 1,\n",
       "  'Petra': 5,\n",
       "  'Democrat': 23,\n",
       "  'British': 7,\n",
       "  'Jews': 2,\n",
       "  'Democratic': 31,\n",
       "  'Swiss': 1,\n",
       "  'Snapfish': 1,\n",
       "  'Zines': 1,\n",
       "  'PhotoScan': 3,\n",
       "  'New Yorkers': 3,\n",
       "  'South Asian': 1,\n",
       "  'Jewish': 7,\n",
       "  'Indians': 5,\n",
       "  'Indian': 3,\n",
       "  'Iraqi': 8,\n",
       "  'Shiite': 2,\n",
       "  'Sunni': 1,\n",
       "  'Kurdish': 4,\n",
       "  'Iraqis': 2,\n",
       "  'Melbournians': 1,\n",
       "  'Texans': 3,\n",
       "  'Panthers': 1,\n",
       "  'Islamists': 2,\n",
       "  'Syrian': 14,\n",
       "  'Islamist': 3,\n",
       "  'Christian': 1,\n",
       "  'jihadists': 4,\n",
       "  'Assyrian': 1,\n",
       "  'Saudi': 1,\n",
       "  'Sorbonne': 1,\n",
       "  'Democrats': 60,\n",
       "  'Russian': 59,\n",
       "  'Trump': 1,\n",
       "  'Russians': 24,\n",
       "  'Congressional Democrats': 1,\n",
       "  'Turkish': 19,\n",
       "  'Islamic': 3,\n",
       "  'European': 5,\n",
       "  'Muslims': 3,\n",
       "  'African': 2,\n",
       "  'Mongolian': 1,\n",
       "  'Tibetan': 1,\n",
       "  'Arab': 3,\n",
       "  'Marines': 2,\n",
       "  'Marine': 4,\n",
       "  'Christians': 1,\n",
       "  'jihadist': 3,\n",
       "  'Afghan': 4,\n",
       "  'Afghans': 1,\n",
       "  'Hanukkah': 1,\n",
       "  'Israeli': 20,\n",
       "  'Brazilian': 2,\n",
       "  'Compaj': 1,\n",
       "  'Portuguese': 2,\n",
       "  'Riverdale': 1,\n",
       "  'Orthodox': 4,\n",
       "  'Cobras': 1,\n",
       "  'Hasidic': 1,\n",
       "  'Islanders': 1,\n",
       "  'Filipino': 1,\n",
       "  'Palestinian': 4,\n",
       "  'Irish': 5,\n",
       "  'Mexican': 13,\n",
       "  'Conservatives': 1,\n",
       "  'Israelis': 2,\n",
       "  'Palestinians': 2,\n",
       "  'Spanish': 4,\n",
       "  'Scottish': 1,\n",
       "  'English': 1,\n",
       "  'Evergrande': 1,\n",
       "  'South American': 1,\n",
       "  'Jacksonians': 1,\n",
       "  'Populist': 1,\n",
       "  'Populists': 2,\n",
       "  'Dems': 2,\n",
       "  'Muslim': 2,\n",
       "  'Turks': 3,\n",
       "  'Syrians': 1,\n",
       "  'Canadian': 3,\n",
       "  'Victorian': 2,\n",
       "  'Catholics': 1,\n",
       "  'dans': 7,\n",
       "  'Irlandais': 1,\n",
       "  'Baroque': 1,\n",
       "  'Venezuelan': 1,\n",
       "  'Tohoku': 1,\n",
       "  'Chekhovian': 1,\n",
       "  'Australian': 1,\n",
       "  'Italian': 9,\n",
       "  'North Korean': 1,\n",
       "  'Western': 1,\n",
       "  'Middle Eastern': 1,\n",
       "  'Libyan': 1,\n",
       "  'Latin American': 1,\n",
       "  'North American': 1,\n",
       "  'Uzbek': 1,\n",
       "  'iTunes': 1,\n",
       "  'Philippine': 1,\n",
       "  'Experian': 2,\n",
       "  'Harland': 2,\n",
       "  'Roman': 1,\n",
       "  'Feudi': 1,\n",
       "  'dramedy': 1,\n",
       "  'Soviet': 2,\n",
       "  'Romanian': 5,\n",
       "  'North Koreans': 1,\n",
       "  'Iranians': 1,\n",
       "  'Mormon Tabernacle Choir': 1},\n",
       " 'PERSON': {'Obama': 114,\n",
       "  'Donald J. Trump’s': 4,\n",
       "  'Phillip J. Blando': 1,\n",
       "  'Rosemary M. Collyer': 1,\n",
       "  'Collyer': 2,\n",
       "  'Trump': 255,\n",
       "  'John A. Boehner': 2,\n",
       "  'Gola White': 1,\n",
       "  'James Fernandez': 2,\n",
       "  'Fernandez': 23,\n",
       "  'Maria Fernandez': 1,\n",
       "  'Sgt': 2,\n",
       "  'Michael J. LoPuzzo': 1,\n",
       "  'Sergeant LoPuzzo': 4,\n",
       "  'Michael R. Bloomberg': 1,\n",
       "  'Raymond W. Kelly': 1,\n",
       "  'Argenis Rosado': 1,\n",
       "  'Hector Espada': 1,\n",
       "  'Alexander Avenue': 1,\n",
       "  'Russell Lewis': 1,\n",
       "  'James P. O’Neill': 2,\n",
       "  'Brian Hennessy': 1,\n",
       "  'O’Neill': 2,\n",
       "  'Bill de Blasio': 4,\n",
       "  'Hennessy': 1,\n",
       "  'Michael Palladino': 1,\n",
       "  'Robert K. Boyce': 1,\n",
       "  'Chief Boyce': 1,\n",
       "  'Howard Landesberg': 1,\n",
       "  'Joseph L. Giacalone': 1,\n",
       "  'Darcel D. Clark': 1,\n",
       "  'Jeff Meenagh': 1,\n",
       "  'Ruben Diaz Jr.': 1,\n",
       "  'Jerry O’Sullivan': 1,\n",
       "  'Walt Disney’s': 1,\n",
       "  'Tyrus Wong': 3,\n",
       "  'Wong': 31,\n",
       "  'Picasso': 1,\n",
       "  'Paul Klee': 1,\n",
       "  'John Canemaker': 1,\n",
       "  'Wong Gen Yeo': 1,\n",
       "  'Romanized Wong Gaing Yoo': 1,\n",
       "  'Gen Yeo': 7,\n",
       "  'Chester A. Arthur': 1,\n",
       "  'Look Tai Yow': 2,\n",
       "  'Lisa See': 1,\n",
       "  'Pamela Tom': 1,\n",
       "  'Tyrus': 1,\n",
       "  'Benji Okubo': 1,\n",
       "  'Canemaker': 4,\n",
       "  'Felix Salten': 1,\n",
       "  'landscapes misty': 1,\n",
       "  'Ruth Kim': 1,\n",
       "  'Okubo': 1,\n",
       "  'See': 2,\n",
       "  'Ruth Wong’s': 1,\n",
       "  'Fred MacMurray': 1,\n",
       "  'Julie Andrews': 1,\n",
       "  'Tom': 1,\n",
       "  'Kay Fong': 1,\n",
       "  'Kim Wong': 1,\n",
       "  'Muhammad Ali': 1,\n",
       "  'Arnold Palmer': 1,\n",
       "  'Carrie Fisher': 1,\n",
       "  'Debbie Reynolds': 1,\n",
       "  'David Bowie': 1,\n",
       "  'persona': 1,\n",
       "  'Prince Rogers Nelson': 1,\n",
       "  'Leonard Cohen': 1,\n",
       "  'merry  ': 1,\n",
       "  'George Michael': 6,\n",
       "  'Paul Kantner': 1,\n",
       "  'Greg Lake': 1,\n",
       "  'Palmer Glenn': 1,\n",
       "  'Maurice White': 1,\n",
       "  'Leon Russell': 1,\n",
       "  'Merle Haggard': 1,\n",
       "  'Ralph Stanley': 1,\n",
       "  'Elvis': 1,\n",
       "  'Scotty Moore': 1,\n",
       "  'George Martin': 1,\n",
       "  'Ali': 3,\n",
       "  'Arnie': 1,\n",
       "  'Hockey': 1,\n",
       "  'Ralph Branca': 1,\n",
       "  'Bobby Thomson': 1,\n",
       "  'Pat Summitt': 1,\n",
       "  'Clyde Lovelette': 1,\n",
       "  'N. B. A.': 1,\n",
       "  'Nate Thurmond': 1,\n",
       "  'Kareem': 1,\n",
       "  'Monte Irvin': 1,\n",
       "  'Antonin Scalia': 1,\n",
       "  'Nancy Reagan': 1,\n",
       "  'John Glenn’s': 1,\n",
       "  'Tom Hayden': 1,\n",
       "  'Daniel Berrigan': 1,\n",
       "  'Phyllis Schlafly’s': 1,\n",
       "  'Janet Reno': 1,\n",
       "  'Clinton': 30,\n",
       "  'Elián González': 1,\n",
       "  'Fidel Castro’s': 1,\n",
       "  'Shimon Peres': 2,\n",
       "  'Elie Wiesel': 1,\n",
       "  'Harper Lee': 1,\n",
       "  'Umberto Eco': 1,\n",
       "  'Pat Conroy': 1,\n",
       "  'Jim Harrison': 1,\n",
       "  'Anita Brookner': 1,\n",
       "  'Alvin Toffler': 1,\n",
       "  'Gloria Naylor': 1,\n",
       "  'William Trevor': 1,\n",
       "  'Peter Shaffer': 1,\n",
       "  'Dario Fo': 1,\n",
       "  'Edward Albee': 1,\n",
       "  'Fisher': 1,\n",
       "  'Reynolds': 1,\n",
       "  'Alan Rickman': 1,\n",
       "  'Severus Snape': 1,\n",
       "  'Zsa Zsa Gabor’s': 1,\n",
       "  'Gene Wilder': 1,\n",
       "  'Garry Shandling': 1,\n",
       "  'Abe Vigoda': 1,\n",
       "  'Barney Miller': 1,\n",
       "  'Jacques Rivette': 1,\n",
       "  'Abbas Kiarostami': 1,\n",
       "  'Andrzej Wajda': 1,\n",
       "  'Ingmar Bergman': 1,\n",
       "  'Akira Kurosawa': 1,\n",
       "  'Noel Neill': 1,\n",
       "  'Alan Young': 1,\n",
       "  'Robert Vaughn': 1,\n",
       "  'William Schallert': 1,\n",
       "  'Patty Duke': 1,\n",
       "  'Dan Haggerty': 1,\n",
       "  'Florence Henderson': 1,\n",
       "  'Alan Thicke': 1,\n",
       "  'Garry Marshall': 1,\n",
       "  'Brian Bedford': 1,\n",
       "  'Tammy Grimes': 1,\n",
       "  'Anne Jackson': 1,\n",
       "  'Zaha Hadid': 1,\n",
       "  'Bill Cunningham': 1,\n",
       "  'Ruth Gruber': 1,\n",
       "  'Marc Riboud': 1,\n",
       "  'Louis Stettner': 1,\n",
       "  'Morley Safer': 1,\n",
       "  'Gwen Ifill': 1,\n",
       "  'John McLaughlin': 1,\n",
       "  'Pierre Boulez': 1,\n",
       "  'Phyllis Curtin': 1,\n",
       "  'Mose Allison': 1,\n",
       "  'Bobby Hutcherson': 1,\n",
       "  'Gato Barbieri': 1,\n",
       "  'Phife Dawg': 1,\n",
       "  'Malik Taylor': 1,\n",
       "  'Juan Gabriel': 1,\n",
       "  'Andrew S. Grove': 1,\n",
       "  'Grant Tinker': 1,\n",
       "  'Kim': 11,\n",
       "  'Donald J. Trump': 37,\n",
       "  'Park': 2,\n",
       "  'Cheong': 1,\n",
       "  'the U. S. mainland': 1,\n",
       "  'Elizabeth II': 1,\n",
       "  'Prince Philip': 1,\n",
       "  'Tsai': 12,\n",
       "  'São Tomé': 1,\n",
       "  'Bonnie S. Glaser': 1,\n",
       "  'Glaser': 1,\n",
       "  'Richard C. Bush': 1,\n",
       "  'Danny Cahill': 1,\n",
       "  'Cahill': 10,\n",
       "  'Jay Leno': 1,\n",
       "  'Regis Philbin': 1,\n",
       "  'Joy Behar': 1,\n",
       "  'Kevin Hall': 1,\n",
       "  'Hall': 6,\n",
       "  'Kidney Diseases': 1,\n",
       "  'Michael Schwartz': 1,\n",
       "  'Schwartz': 1,\n",
       "  'Robert Huizenga': 1,\n",
       "  'David Ludwig': 1,\n",
       "  'Margaret Jackson': 1,\n",
       "  'leptin levels fall': 1,\n",
       "  'Erinn Egbert': 1,\n",
       "  'Egbert': 1,\n",
       "  'the N. I. H.': 2,\n",
       "  'Sean Algaier': 1,\n",
       "  'N. C.': 2,\n",
       "  'Leptin': 1,\n",
       "  'Joseph Proietto': 1,\n",
       "  'Proietto': 2,\n",
       "  'Lee Kaplan': 1,\n",
       "  'Michael Rosenbaum': 1,\n",
       "  'Rosenbaum': 2,\n",
       "  'Ludwig': 1,\n",
       "  'Hillary Kerr': 2,\n",
       "  'Andy Warhol': 1,\n",
       "  'Jonathan Leahy': 1,\n",
       "  'Kerr': 27,\n",
       "  'Leahy': 24,\n",
       "  'Lena Dunham': 1,\n",
       "  'Mary': 1,\n",
       "  'Tom Wolfe': 1,\n",
       "  'Katherine Power': 1,\n",
       "  'Power': 1,\n",
       "  'boozy brunch': 1,\n",
       "  'Ben Schneider': 1,\n",
       "  'John Newman': 1,\n",
       "  'Katie': 1,\n",
       "  'Vacationer Remix': 1,\n",
       "  'Deleted Scenes': 1,\n",
       "  'the Roger Room': 1,\n",
       "  'Tom Waits': 1,\n",
       "  'Jack Antonoff': 1,\n",
       "  'Dunham': 2,\n",
       "  'Al Wertheimer': 1,\n",
       "  'Frank Sinatra': 2,\n",
       "  'Ronald Reagan': 3,\n",
       "  'Kirk Douglas': 1,\n",
       "  'Zsa Zsa Gabor': 1,\n",
       "  'Reem Acra': 1,\n",
       "  'Jen Atkin': 1,\n",
       "  'Joey Maalouf': 1,\n",
       "  'App': 1,\n",
       "  'Eva Chen': 1,\n",
       "  'Leigh Belz Ray': 1,\n",
       "  'Hillary': 2,\n",
       "  'Ray': 1,\n",
       "  'Flora': 1,\n",
       "  'Richard': 1,\n",
       "  'Marie Leahy': 1,\n",
       "  'Carole Kerr': 1,\n",
       "  'Marshall Goldsmith': 1,\n",
       "  'James Kavanaugh': 1,\n",
       "  'Mary Oliver': 1,\n",
       "  'Muñiz': 9,\n",
       "  'José': 2,\n",
       "  'Zoraida Muñiz': 1,\n",
       "  'Dickens': 1,\n",
       "  'José Jr.': 4,\n",
       "  'Maria': 2,\n",
       "  'José Sr': 1,\n",
       "  'José Sr.': 1,\n",
       "  'Zoraida': 1,\n",
       "  'Hillary Clinton': 5,\n",
       "  'Obama’s': 8,\n",
       "  'John Kasich': 1,\n",
       "  'Charles E. Grassley': 2,\n",
       "  'Grassley': 1,\n",
       "  'Tom Kiernan': 1,\n",
       "  'Kiernan': 1,\n",
       "  'David G. Victor': 1,\n",
       "  'Victor': 3,\n",
       "  'Petra Nova': 3,\n",
       "  'Nippon Oil and Gas Exploration': 1,\n",
       "  'David Knox': 1,\n",
       "  'Knox': 1,\n",
       "  'C. C. S.': 2,\n",
       "  'Julio Friedmann': 1,\n",
       "  'David Mohler': 1,\n",
       "  'Mark Brownstein': 1,\n",
       "  'Heidi Heitkamp': 1,\n",
       "  'Heitkamp': 2,\n",
       "  'Sheldon Whitehouse': 1,\n",
       "  'Jeff Erikson': 1,\n",
       "  'Rodney Allam': 1,\n",
       "  'Bill Brown': 1,\n",
       "  'Fatima Maria Ahmad': 1,\n",
       "  'Daniel McCarthy': 1,\n",
       "  'John Coequyt': 1,\n",
       "  'Friedmann': 1,\n",
       "  'Sylvester Stallone': 1,\n",
       "  'Fabio': 1,\n",
       "  'George W. Bush': 8,\n",
       "  'Mickey Mouse': 1,\n",
       "  'Jeff Greene': 1,\n",
       "  'Howie Carr': 1,\n",
       "  'Carr': 3,\n",
       "  'Eric': 1,\n",
       "  'Donald Jr.': 1,\n",
       "  'Joe Scarborough': 1,\n",
       "  'Mika Brzezinski': 1,\n",
       "  'Douglas Brinkley': 1,\n",
       "  'Chris Ruddy': 1,\n",
       "  'Ruddy': 1,\n",
       "  'Laura Ingraham': 1,\n",
       "  'Donald Trump': 1,\n",
       "  'Rudolph W. Giuliani': 1,\n",
       "  'Mitt Romney': 2,\n",
       "  'Rex W. Tillerson': 2,\n",
       "  'Exxon': 1,\n",
       "  'Brian Burns': 1,\n",
       "  'Joseph P. Kennedy': 1,\n",
       "  'Isaac Perlmutter': 1,\n",
       "  'Robert K. Kraft': 1,\n",
       "  'Carlos Slim': 1,\n",
       "  'Harry Hurt': 1,\n",
       "  'David H. Koch': 1,\n",
       "  'Hurt': 2,\n",
       "  'Robin Bernstein': 1,\n",
       "  'Donald': 4,\n",
       "  'Brinkley': 1,\n",
       "  'Endorphin': 1,\n",
       "  'Mpix': 1,\n",
       "  'washi tape': 1,\n",
       "  'Risograph': 1,\n",
       "  'David Pogue’s': 1,\n",
       "  'Wirecutter': 2,\n",
       "  'Betsy Morris': 1,\n",
       "  'Nos': 1,\n",
       "  'Harihareswara': 3,\n",
       "  'Andrew M. Cuomo': 2,\n",
       "  'Cuomo': 15,\n",
       "  'Thomas F. Prendergast': 2,\n",
       "  'Jill Tallmer': 1,\n",
       "  'Margot Tallmer': 1,\n",
       "  'Tallmer': 1,\n",
       "  'George Braith': 1,\n",
       "  'Braith': 3,\n",
       "  'Daniel Boulud': 1,\n",
       "  'alto': 1,\n",
       "  'Ian Ma': 1,\n",
       "  'Emanuel A. M. E. Church': 1,\n",
       "  'S. C.': 1,\n",
       "  'Roof': 41,\n",
       "  'Richard M. Gergel': 1,\n",
       "  'David I. Bruck': 1,\n",
       "  'Gergel': 3,\n",
       "  'Bruck': 8,\n",
       "  'the F. B. I.': 5,\n",
       "  'Robert Dunham': 1,\n",
       "  'Michael T. Slager': 1,\n",
       "  'Joseph A. Darby': 1,\n",
       "  'Darby': 1,\n",
       "  'John H. Blume': 1,\n",
       "  'Peter D. Greenspun': 1,\n",
       "  'John A. Muhammad': 1,\n",
       "  'Muhammad': 1,\n",
       "  'Greenspun': 2,\n",
       "  'Narendra Modi': 1,\n",
       "  'Modi': 19,\n",
       "  'Hem Raj Chechi': 1,\n",
       "  'Chechi': 2,\n",
       "  'Eswar S. Prasad': 1,\n",
       "  'Prasad': 1,\n",
       "  'Mohandas K. Gandhi': 1,\n",
       "  'Gandhi': 2,\n",
       "  'Mahatma': 1,\n",
       "  'Geng Xiao': 1,\n",
       "  'Harsh Pant': 1,\n",
       "  'Xiao': 1,\n",
       "  'Pant': 4,\n",
       "  'Nagender Tiwari': 1,\n",
       "  'Raj Kumar Bindal': 1,\n",
       "  'Surjit Bhalla': 1,\n",
       "  'Bhalla': 1,\n",
       "  'François Hollande': 2,\n",
       "  'Hollande': 4,\n",
       "  'Asaad Hashim': 1,\n",
       "  'Hashim': 1,\n",
       "  'Sadr': 1,\n",
       "  'Ali Abbas': 1,\n",
       "  'Abadi': 1,\n",
       "  'Fuad Masum': 1,\n",
       "  'creeks': 1,\n",
       "  'Anthony Boxshall': 1,\n",
       "  'Boxshall': 2,\n",
       "  'Sam Riley': 1,\n",
       "  'Aaron Rodgers': 1,\n",
       "  'Redskins': 5,\n",
       "  'the N. F. C. North': 1,\n",
       "  'Seattle Seahawks Time': 1,\n",
       "  'Seahawks': 2,\n",
       "  'Earl Thomas': 1,\n",
       "  'Rams': 1,\n",
       "  'Tom Savage': 1,\n",
       "  'Brock Osweiler': 1,\n",
       "  'Derek Carr': 2,\n",
       "  'Matt McGloin': 2,\n",
       "  'McGloin': 1,\n",
       "  'Connor Cook': 1,\n",
       "  'Ryan Tannehill': 1,\n",
       "  'Matt Moore': 1,\n",
       "  'Jay Ajayi': 1,\n",
       "  'the N. F. C.': 1,\n",
       "  'Carey': 13,\n",
       "  'Bulochnikov': 1,\n",
       "  'Dick Clark Productions': 1,\n",
       "  'Robert Goldstein': 1,\n",
       "  'Goldstein': 1,\n",
       "  'Nicole Perna': 1,\n",
       "  'Yves Ubelmann': 1,\n",
       "  'Ubelmann': 5,\n",
       "  'Houmam Saad': 1,\n",
       "  'Martinez': 1,\n",
       "  'Bashar  ': 1,\n",
       "  'Nineveh': 1,\n",
       "  'Khorsabad': 1,\n",
       "  'Abdulkarim': 1,\n",
       "  'Pascal Butterlin': 1,\n",
       "  'Butterlin': 1,\n",
       "  'Mari': 2,\n",
       "  'Cheikhmous Ali': 1,\n",
       "  'Lens': 1,\n",
       "  'George Michael’s': 3,\n",
       "  'Steven Meisel': 1,\n",
       "  'Madonna': 3,\n",
       "  'Chris Isaak': 1,\n",
       "  'Janet Jackson': 1,\n",
       "  'David Fincher': 4,\n",
       "  'Michael': 2,\n",
       "  'Naomi Campbell': 2,\n",
       "  'Linda Evangelista': 1,\n",
       "  'Christy Turlington': 1,\n",
       "  'Cindy Crawford': 1,\n",
       "  'Tatjana Patitz': 2,\n",
       "  'Camilla Nickerson': 2,\n",
       "  'Guido Palau': 1,\n",
       "  'Carol Brown': 1,\n",
       "  'John Pearson': 2,\n",
       "  'Peter Lindbergh': 1,\n",
       "  'George': 5,\n",
       "  'Christy': 4,\n",
       "  'Thierry Mugler': 1,\n",
       "  'Kate': 2,\n",
       "  'Linda': 9,\n",
       "  'Naomi': 2,\n",
       "  'L. A. Herb Ritts': 1,\n",
       "  'Audrey Hepburn': 1,\n",
       "  'Grace Kelly': 1,\n",
       "  'Ava Gardner': 1,\n",
       "  'Candis Cayne': 1,\n",
       "  'N. Y. C.': 1,\n",
       "  'Sherry Vine': 1,\n",
       "  'O. K.': 2,\n",
       "  'Alan Hunter': 1,\n",
       "  'V. J. s.': 1,\n",
       "  'Zac Posen': 1,\n",
       "  'Mitch McConnell': 3,\n",
       "  'Obstacles': 1,\n",
       "  'Newt Gingrich': 1,\n",
       "  'Bob Dole': 1,\n",
       "  'Trent Lott': 1,\n",
       "  'Obamacare': 2,\n",
       "  'Lott': 1,\n",
       "  'Chuck Schumer': 7,\n",
       "  'Patty Murray': 1,\n",
       "  'Paul D. Ryan': 6,\n",
       "  'Jeff Sessions': 3,\n",
       "  'Dianne Feinstein': 2,\n",
       "  'Sessions': 2,\n",
       "  'Tom Mentzer': 1,\n",
       "  'McConnell': 2,\n",
       "  'Merrick B. Garland': 2,\n",
       "  'Tom Cole': 1,\n",
       "  'Garland': 1,\n",
       "  'Newt': 1,\n",
       "  'Bill Clinton': 4,\n",
       "  'Cory Gardner': 2,\n",
       "  'Cole': 1,\n",
       "  'Choi': 1,\n",
       "  'Narendra Modi’s': 1,\n",
       "  'U. S.': 1,\n",
       "  'Benjamin Netanyahu': 4,\n",
       "  'Richard Nixon': 1,\n",
       "  'Nixon': 1,\n",
       "  'Mao Zedong': 1,\n",
       "  'J. R. R. Tolkien': 1,\n",
       "  'Xi Jinping': 4,\n",
       "  'Sammy Hagar': 1,\n",
       "  'Richard M. Nixon': 1,\n",
       "  'm. p. h.': 2,\n",
       "  'Chris Stanford': 1,\n",
       "  'James N. Mattis': 2,\n",
       "  'Ralph Dengler': 1,\n",
       "  'Dengler': 1,\n",
       "  'Mattis': 5,\n",
       "  'T. G. Taylor': 1,\n",
       "  'Taylor': 2,\n",
       "  'an R. O. T. C.': 1,\n",
       "  'David H. Petraeus': 2,\n",
       "  'C. I. A.': 5,\n",
       "  'Escape': 1,\n",
       "  'P. O. W.s': 1,\n",
       "  'Hicks': 1,\n",
       "  'Bush': 5,\n",
       "  'Donald J. Guter': 1,\n",
       "  'Nagem Sadoon Hatab': 1,\n",
       "  'Jessica Lynch': 1,\n",
       "  'Hatab': 7,\n",
       "  'William B. Gallo': 1,\n",
       "  'Numan Kurtulmus': 1,\n",
       "  'Kurtulmus': 2,\n",
       "  'Hurriyet': 1,\n",
       "  'Aiymkan Kulukeyeva': 1,\n",
       "  'Bashar': 2,\n",
       "  'Andrey G. Karlov': 1,\n",
       "  'Aleppo': 3,\n",
       "  'Obama meant': 1,\n",
       "  'George W. Bush’s': 1,\n",
       "  'Mike Mullen': 1,\n",
       "  'Bruce Riedel': 1,\n",
       "  'Vali R. Nasr': 1,\n",
       "  'Nasr': 1,\n",
       "  'Karl W. Eikenberry': 1,\n",
       "  'Eikenberry': 2,\n",
       "  'Benjamin J. Rhodes': 1,\n",
       "  'Ryan Crocker': 1,\n",
       "  'Osama bin Laden': 2,\n",
       "  'Hamid Karzai': 1,\n",
       "  'Karzai': 3,\n",
       "  'Crocker': 1,\n",
       "  'Ashraf Ghani': 1,\n",
       "  'Rhodes': 2,\n",
       "  'Oruzgan': 1,\n",
       "  'Daniel F. Feldman': 1,\n",
       "  'Ghani': 1,\n",
       "  'Joseph R. Biden Jr.': 3,\n",
       "  'Martin E. Dempsey': 1,\n",
       "  'Mullen': 1,\n",
       "  'Dempsey': 1,\n",
       "  'N. Y.': 4,\n",
       "  'Tova Weinstock': 1,\n",
       "  'Laura Cattano': 1,\n",
       "  'Marie Kondo': 1,\n",
       "  'Sharon Lowenheim': 1,\n",
       "  'Lowenheim': 6,\n",
       "  'Faith Roberson': 1,\n",
       "  'Roberson': 3,\n",
       "  'Netanyahu': 25,\n",
       "  'Avichai Mandelblit': 1,\n",
       "  'Ronald S. Lauder': 1,\n",
       "  'Lauder': 3,\n",
       "  'Helena Beilin': 1,\n",
       "  'Daniel B. Shapiro': 1,\n",
       "  'Nahum Barnea': 1,\n",
       "  'Barnea': 1,\n",
       "  'Isaac Herzog': 1,\n",
       "  'Herzog': 1,\n",
       "  'Yesh Atid': 1,\n",
       "  'Ehud Olmert': 1,\n",
       "  'Olmert': 2,\n",
       "  'Caesarea': 1,\n",
       "  'David Shimron': 1,\n",
       "  'Arnaud Mimran': 1,\n",
       "  'Myriam El Khomri': 1,\n",
       "  'Lyon': 1,\n",
       "  'Paul Stacey': 1,\n",
       "  'Ken Thrower': 1,\n",
       "  'Gronych': 2,\n",
       "  'Stacey': 2,\n",
       "  'Janine Massey': 1,\n",
       "  'Luís Carlos Valois': 1,\n",
       "  'P. C. C.': 2,\n",
       "  'Elon Musk': 1,\n",
       "  'McGregor': 1,\n",
       "  'Mini Cooper': 1,\n",
       "  'S. A. R.': 2,\n",
       "  'Amir Gavarin': 1,\n",
       "  'Yoni Stone': 1,\n",
       "  'Judaic': 1,\n",
       "  'N. J.': 4,\n",
       "  'Jared Kushner': 2,\n",
       "  'Kushner': 5,\n",
       "  'R. T. M. A.': 1,\n",
       "  'Elizabeth': 1,\n",
       "  'David Yeshivah': 1,\n",
       "  'Stone': 2,\n",
       "  'David Kolb': 1,\n",
       "  'Seth Gordon': 1,\n",
       "  'Gordon': 1,\n",
       "  'Gavarin': 1,\n",
       "  'Mayer Schiller': 1,\n",
       "  'Rabbi Schiller': 4,\n",
       "  'Nick Fotiu': 1,\n",
       "  'Kolb': 1,\n",
       "  'Gordie': 2,\n",
       "  'Howie Falkenstein': 1,\n",
       "  'Falkenstein': 3,\n",
       "  'Mites': 1,\n",
       "  'the S. A. R. Sting’s': 1,\n",
       "  'Jonathan Lethem': 1,\n",
       "  'Walt Whitman': 1,\n",
       "  'James Baldwin': 1,\n",
       "  'Marilynne Robinson': 1,\n",
       "  'Lethem': 17,\n",
       "  'Melissa Barton': 1,\n",
       "  'Beinecke': 1,\n",
       "  'Barton': 1,\n",
       "  'Glenn Horowitz': 1,\n",
       "  'Ed Koch': 1,\n",
       "  'Philip K. Dick': 1,\n",
       "  'Devo': 1,\n",
       "  'Oliver Sacks': 1,\n",
       "  'Samuel J. Underberg': 1,\n",
       "  'Billboard': 1,\n",
       "  'Donna Tartt': 1,\n",
       "  'Paul Auster': 1,\n",
       "  'Suzanne Vega': 1,\n",
       "  'Jennifer Egan': 1,\n",
       "  'Thomas Berger': 1,\n",
       "  'Ursula K. Le Guin': 1,\n",
       "  'David Bowman': 1,\n",
       "  'David': 1,\n",
       "  'Rey Canunayon': 1,\n",
       "  'Canunayon': 9,\n",
       "  'Greg Hankins': 1,\n",
       "  'Hankins': 1,\n",
       "  'Kevin McCarthy': 2,\n",
       "  'Robert W. Goodlatte': 1,\n",
       "  'Steve King': 1,\n",
       "  'Mark Sanford': 1,\n",
       "  'Ryan': 11,\n",
       "  'McCarthy': 5,\n",
       "  'Steve Pearce': 1,\n",
       "  'Melvin Watt': 1,\n",
       "  'Mark Meadows': 1,\n",
       "  'Roger Williams': 1,\n",
       "  'Markwayne Mullin': 1,\n",
       "  'Cathy McMorris Rodgers': 1,\n",
       "  'Bobby L. Rush': 1,\n",
       "  'Luis V. Gutiérrez': 1,\n",
       "  'Goodlatte': 2,\n",
       "  'Noah Bookbinder': 1,\n",
       "  'Mike Pence': 8,\n",
       "  'Robert Lighthizer': 2,\n",
       "  'Eric H. Holder Jr.': 2,\n",
       "  'B. J. Miller': 1,\n",
       "  'Kelly': 39,\n",
       "  '• U. S.': 1,\n",
       "  'John Colone': 1,\n",
       "  'Adiga': 1,\n",
       "  'Ruby Tandoh': 1,\n",
       "  'Melania Trump  ': 1,\n",
       "  'Melanija Knavs': 1,\n",
       "  'John Quincy Adams': 1,\n",
       "  'Louisa': 3,\n",
       "  'John Adams': 1,\n",
       "  'Adeel Hassan': 1,\n",
       "  'Photographs': 2,\n",
       "  'Pete Sessions': 1,\n",
       "  'Dick Cheney': 2,\n",
       "  'Liz': 1,\n",
       "  'Mike Enzi': 1,\n",
       "  'James L. Madara': 1,\n",
       "  'Nancy Pelosi': 4,\n",
       "  'Pelosi': 1,\n",
       "  'I. O.': 1,\n",
       "  'Richard Trumka': 1,\n",
       "  'Trumka': 2,\n",
       "  'Lighthizer': 8,\n",
       "  'Orrin Hatch': 1,\n",
       "  'Hatch': 1,\n",
       "  'Bob': 1,\n",
       "  'Peter Navarro': 1,\n",
       "  'Wilbur Ross': 2,\n",
       "  'U. S. T. R.': 1,\n",
       "  'Alan Wolff': 1,\n",
       "  'Navarro': 1,\n",
       "  'Gary D. Cohn': 2,\n",
       "  'Terry Branstad': 1,\n",
       "  'Scott Lincicome': 1,\n",
       "  'Lincicome': 1,\n",
       "  'Nafta': 1,\n",
       "  'Cruze': 1,\n",
       "  'Mustang': 1,\n",
       "  'Mark Fields': 1,\n",
       "  'Reagan': 4,\n",
       "  'John McCain': 4,\n",
       "  'Julian Assange': 1,\n",
       "  'Assange': 15,\n",
       "  'Sean Hannity': 3,\n",
       "  'Hillary Clinton’s': 3,\n",
       "  'John Podesta': 2,\n",
       "  'Hannity': 1,\n",
       "  'Donna Brazile': 2,\n",
       "  'Podesta': 10,\n",
       "  'Bernie Sanders': 2,\n",
       "  'Brazile': 2,\n",
       "  'Pence': 5,\n",
       "  'Manigault': 3,\n",
       "  'Bill Stepien': 1,\n",
       "  'Chris Christie': 2,\n",
       "  'Keith Schiller': 1,\n",
       "  'John DeStefano': 1,\n",
       "  'George Gigicos': 1,\n",
       "  'Joe Hagin': 1,\n",
       "  'Roanld Reagan': 1,\n",
       "  'George Bush': 1,\n",
       "  'Rick Dearborn': 1,\n",
       "  'Katie Walsh': 1,\n",
       "  'Priebus': 1,\n",
       "  'Kellyanne Conway': 1,\n",
       "  'Walsh': 1,\n",
       "  'Schumer': 8,\n",
       "  'Jay Clayton': 1,\n",
       "  'Vladimir V. Putin': 5,\n",
       "  'Holder': 5,\n",
       "  'Kevin de León': 1,\n",
       "  'de León': 4,\n",
       "  'Anthony Rendon': 1,\n",
       "  'Jerry Brown': 1,\n",
       "  'Xavier Becerra': 1,\n",
       "  'Kamala D. Harris': 1,\n",
       "  'Becerra': 1,\n",
       "  'Brown': 6,\n",
       "  'Elor Azaria': 1,\n",
       "  'David Enoch': 1,\n",
       "  'Sergeant Azaria': 11,\n",
       "  'Avigdor Lieberman': 1,\n",
       "  'Lieberman': 2,\n",
       "  'Naftali Bennett': 1,\n",
       "  'Shelly Yacimovich': 1,\n",
       "  'Maya Heller': 1,\n",
       "  'Describing Sergeant Azaria’s': 1,\n",
       "  'Abed     ': 1,\n",
       "  'Ilan Katz': 1,\n",
       "  'Gadi Eisenkot': 1,\n",
       "  'Sharif': 5,\n",
       "  'Tom Naaman': 1,\n",
       "  'Ahmad Tibi': 1,\n",
       "  'Tibi': 1,\n",
       "  'Johnson  Johnson': 1,\n",
       "  'Jack Groppel': 1,\n",
       "  'Groppel': 1,\n",
       "  'S. P.': 1,\n",
       "  'Ellie Mae': 1,\n",
       "  'Douglas Dynamics': 1,\n",
       "  'Megyn Kelly': 2,\n",
       "  'Murdoch': 1,\n",
       "  'Bill O’Reilly': 2,\n",
       "  'Roger Ailes': 2,\n",
       "  'Andrew Lack': 2,\n",
       "  'Ailes': 3,\n",
       "  'Rupert Murdoch': 1,\n",
       "  'Lack': 5,\n",
       "  'Douglas Brunt': 1,\n",
       "  'Brian Williams': 2,\n",
       "  'Rachel Maddow': 1,\n",
       "  'Lawrence O’Donnell': 1,\n",
       "  'Megyn': 1,\n",
       "  'Charlie Rose': 3,\n",
       "  'Oprah Winfrey': 1,\n",
       "  'Barbara Walters': 1,\n",
       "  'Robert Shapiro': 1,\n",
       "  'Laverne Cox  ': 1,\n",
       "  'Jane Pauley': 1,\n",
       "  'Meredith Vieira': 1,\n",
       "  'Katie Couric': 1,\n",
       "  'Anderson Cooper': 1,\n",
       "  'Pauley': 1,\n",
       "  'p. m. Eastern': 1,\n",
       "  'Greta Van Susteren': 1,\n",
       "  'Sandra Smith': 1,\n",
       "  'Trish Regan': 1,\n",
       "  'Martha MacCallum': 1,\n",
       "  'Tucker Carlson': 1,\n",
       "  'Fox': 1,\n",
       "  'Hogwarts': 1,\n",
       "  'Wang Kai': 1,\n",
       "  'Cristiano Ronaldo': 1,\n",
       "  'Ronaldo': 1,\n",
       "  'Messi': 1,\n",
       "  'Antonio Conte': 1,\n",
       "  'Xi': 6,\n",
       "  'Simon Chadwick': 1,\n",
       "  'Cameron Wilson': 1,\n",
       "  'Xu Yun': 1,\n",
       "  'Wilson': 5,\n",
       "  'David Beckham': 1,\n",
       "  'FIFA TMS': 1,\n",
       "  'Dai Wei': 1,\n",
       "  'r. Xi’s old': 1,\n",
       "  'Dai': 1,\n",
       "  'Liu Jiangnan': 1,\n",
       "  'Sergio Zarco Diaz': 1,\n",
       "  'Zhang Lu': 1,\n",
       "  'Zhang': 3,\n",
       "  'Lin Yanling': 1,\n",
       "  'Bill Gates': 1,\n",
       "  'Jeff Bezos': 1,\n",
       "  'Bezos': 1,\n",
       "  'the U. S.': 2,\n",
       "  'Julius Genachowski': 1,\n",
       "  'Genachowski': 2,\n",
       "  'Tom Wheeler': 1,\n",
       "  'Panzhihua': 1,\n",
       "  'Mao': 1,\n",
       "  'Chen Zhongshu': 1,\n",
       "  'Chen': 2,\n",
       "  'Li Jianqin': 1,\n",
       "  'Zhang Yan': 1,\n",
       "  'Li': 1,\n",
       "  'killings': 1,\n",
       "  'Stephen P. Davis': 1,\n",
       "  'David M. Kennedy': 1,\n",
       "  'Kennedy': 2,\n",
       "  'Sarah Palin’s': 1,\n",
       "  'Steve Bannon': 1,\n",
       "  'Howard Dean': 1,\n",
       "  'Brexit': 1,\n",
       "  'Joseph McCarthy': 1,\n",
       "  'Richard Hofstadter': 1,\n",
       "  'Dwight Eisenhower': 1,\n",
       "  'Adlai Stevenson': 1,\n",
       "  'C. Wright Mills': 1,\n",
       "  'William F. Buckley Jr.': 1,\n",
       "  'Barry Goldwater': 1,\n",
       "  'Lyndon Johnson': 1,\n",
       "  'Rush Limbaugh': 1,\n",
       "  'Bill Clinton’s': 1,\n",
       "  'Christopher Lasch': 1,\n",
       "  'Chris Hayes': 1,\n",
       "  'Litman': 2,\n",
       "  'Michelis': 3,\n",
       "  'Fallsgraff': 8,\n",
       "  'Purcell': 3,\n",
       "  'Bui': 2,\n",
       "  'Meagher': 3,\n",
       "  'Grossman': 2,\n",
       "  'Fogelman': 3,\n",
       "  'Phillips': 4,\n",
       "  'Whelden': 1,\n",
       "  'Delaney': 1,\n",
       "  'Roth': 3,\n",
       "  'Marini': 5,\n",
       "  'Powell': 6,\n",
       "  'Albertson': 3,\n",
       "  'Turke': 3,\n",
       "  'Helmling': 3,\n",
       "  'Stucky': 4,\n",
       "  'Mathiowetz': 3,\n",
       "  'N. H.': 1,\n",
       "  'Alicia Rivera': 1,\n",
       "  'Rivera': 16,\n",
       "  'Nelson': 7,\n",
       "  'Alyssa': 2,\n",
       "  'Rafael': 1,\n",
       "  'Joaquin': 1,\n",
       "  'Chris Collins': 1,\n",
       "  'Collins': 1,\n",
       "  'Donald Trump’s': 1,\n",
       "  'Ted Cruz': 1,\n",
       "  'John Cornyn': 1,\n",
       "  'Cornyn': 1,\n",
       "  'Debbie Stabenow': 1,\n",
       "  'Hank Johnson': 1,\n",
       "  'Johnson': 1,\n",
       "  'Jeff Merkley': 1,\n",
       "  'A.': 1,\n",
       "  'Robert C. Byrd': 1,\n",
       "  'Walter B. Jones': 1,\n",
       "  'Tom DeLay': 1,\n",
       "  'John Feehery': 1,\n",
       "  'Jones': 1,\n",
       "  'Ivanka Trump': 1,\n",
       "  'Dan K. Rapoport': 1,\n",
       "  'William F. X. Moody': 1,\n",
       "  'Tony Podesta': 1,\n",
       "  'Tracy Place': 1,\n",
       "  'John Damgard': 1,\n",
       "  'Damgard': 1,\n",
       "  'Renee Zlotnick Kraft': 1,\n",
       "  'Rapoport': 2,\n",
       "  'Vladimir Ashurkov': 1,\n",
       "  'Aleksei A. Navalny': 1,\n",
       "  'Navalny': 1,\n",
       "  'Ashurkov': 1,\n",
       "  'Walter J. Clayton': 1,\n",
       "  'Clayton': 20,\n",
       "  'Jay': 1,\n",
       "  'Mary Jo White': 1,\n",
       "  'Rupert Murdoch’s': 1,\n",
       "  'Kenneth D. Lewis': 1,\n",
       "  'Laura S. Unger': 1,\n",
       "  'Sullivan  Cromwell': 1,\n",
       "  'Warren E. Buffett’s': 1,\n",
       "  'Berkshire Hathaway': 1,\n",
       "  'The S. E. C.': 1,\n",
       "  'Steven T. Mnuchin': 1,\n",
       "  'Stephen K. Bannon': 1,\n",
       "  'Sullivan': 1,\n",
       "  'H. Rodgin Cohen': 1,\n",
       "  'Cohen': 2,\n",
       "  'Sherrod Brown': 1,\n",
       "  'the S. E. C.': 2,\n",
       "  'Richard Truesdell': 1,\n",
       "  'Harvey Pitt': 1,\n",
       "  'Pitt': 1,\n",
       "  'Jeb Bush’s': 1,\n",
       "  'Brad Whitman': 1,\n",
       "  'S. C.  ': 1,\n",
       "  'Dylann S. Roof': 1,\n",
       "  'Nathan S. Williams': 1,\n",
       "  'Williams': 2,\n",
       "  'F. B. I.': 13,\n",
       "  'Clementa C. Pinckney': 1,\n",
       "  'Jennifer Benjamin Pinckney': 1,\n",
       "  'Pinckney': 10,\n",
       "  'Julius N. Richardson': 1,\n",
       "  'Kylon Middleton': 1,\n",
       "  'Cynthia Hurd': 1,\n",
       "  'Susie Jackson': 1,\n",
       "  '87 Ethel Lee Lance': 1,\n",
       "  'Daniel Lee Simmons Sr': 1,\n",
       "  'Sharonda': 1,\n",
       "  'Myra Thompson': 1,\n",
       "  'Thompson': 3,\n",
       "  'Anthony B. Thompson': 1,\n",
       "  'Reina': 1,\n",
       "  'Recep Tayyip Erdogan': 1,\n",
       "  'Fethullah Gulen': 1,\n",
       "  'Erdogan': 8,\n",
       "  'Binali Yildirim': 1,\n",
       "  'Yildirim': 1,\n",
       "  'Aydin Engin': 1,\n",
       "  'Bosporus': 1,\n",
       "  'Soli Ozel': 1,\n",
       "  'Tugrul Eryilmaz': 1,\n",
       "  'Luis Buñuel': 1,\n",
       "  'Soner Cagaptay': 1,\n",
       "  'Gulen': 1,\n",
       "  'Assad': 1,\n",
       "  'Jens Laerke': 1,\n",
       "  'Mevlut Cavusoglu': 1,\n",
       "  'Laerke': 1,\n",
       "  'Sajjad Malik': 1,\n",
       "  'Malik': 2,\n",
       "  'Port Hardy': 2,\n",
       "  'Emily Carr': 1,\n",
       "  'Celine Dion': 1,\n",
       "  'B. C.': 1,\n",
       "  'Claude': 1,\n",
       "  'Madeleine Thien': 1,\n",
       "  'Charles Kingsmill': 1,\n",
       "  'Diana': 1,\n",
       "  'David Bearman': 1,\n",
       "  'Jennifer Trant': 1,\n",
       "  'Cory Doctorow': 1,\n",
       "  'Pierre Berton': 1,\n",
       "  'Kim Fu': 1,\n",
       "  'Hans Johann': 1,\n",
       "  'Barbara': 1,\n",
       "  'Sarah Nicole': 1,\n",
       "  'Sarah': 1,\n",
       "  'Opa': 1,\n",
       "  'Sarah Nicole Prickett': 1,\n",
       "  'Chemin St.': 1,\n",
       "  'Hunter Mills': 1,\n",
       "  'Élise Turcotte': 1,\n",
       "  'Guyana': 1,\n",
       "  'Allison M. Charette': 1,\n",
       "  'village de mon': 2,\n",
       "  'j’aimais la': 1,\n",
       "  'de ma tête': 1,\n",
       "  'Je voyais aussi': 1,\n",
       "  'aussi à mon': 1,\n",
       "  'mon doigt sur un': 1,\n",
       "  'J’avais aussi': 1,\n",
       "  'Je': 1,\n",
       "  'laisse': 1,\n",
       "  'J’imaginais aussi': 1,\n",
       "  'la famine': 1,\n",
       "  'laissé': 1,\n",
       "  'aussi': 1,\n",
       "  'de la': 1,\n",
       "  'Je pensais': 1,\n",
       "  'mon': 1,\n",
       "  'historienne de Stanbridge Station': 1,\n",
       "  'belle': 1,\n",
       "  'du Québec': 1,\n",
       "  'de Hunter Mills': 1,\n",
       "  'Québec': 1,\n",
       "  'qui': 2,\n",
       "  'ma terre': 1,\n",
       "  'ma maison': 1,\n",
       "  'j’y ai': 1,\n",
       "  'le débarras': 1,\n",
       "  'une maison à l’abandon de vieux': 1,\n",
       "  'de vieux': 1,\n",
       "  'qui ronronne': 1,\n",
       "  'Maureen Towey': 1,\n",
       "  'Josh Haner': 1,\n",
       "  'Pink': 1,\n",
       "  'Jimi Hendrix': 1,\n",
       "  'Monte Carlo': 1,\n",
       "  'Manu Katché': 1,\n",
       "  'Richard Bona': 1,\n",
       "  'Ibrahim Maalouf': 1,\n",
       "  'Basil’s Bar': 1,\n",
       "  'Joe Louis Walker': 1,\n",
       "  'Mick Jagger': 1,\n",
       "  'Michael Kors': 1,\n",
       "  'Anna Netrebko': 1,\n",
       "  'Gustavo Dudamel': 1,\n",
       "  'Roger Waters': 1,\n",
       "  'Opéra de Montréal': 1,\n",
       "  'Belmond Hiram': 1,\n",
       "  ...},\n",
       " 'ORG': {'Trump': 23,\n",
       "  'House': 84,\n",
       "  'Capitol Hill': 10,\n",
       "  'the United States Court of Appeals': 1,\n",
       "  'Congress': 68,\n",
       "  'the Affordable Care Act': 9,\n",
       "  'The Justice Department': 1,\n",
       "  'the Treasury Department': 1,\n",
       "  'The White House': 2,\n",
       "  'the White House': 31,\n",
       "  'Obama White House': 1,\n",
       "  'New York Times': 3,\n",
       "  'Police Department': 2,\n",
       "  'the Police Department’s': 1,\n",
       "  'Times': 27,\n",
       "  'the Betances Houses': 5,\n",
       "  'Hennessy': 1,\n",
       "  'Police Service Area 7': 1,\n",
       "  'the New York of the 1980s': 1,\n",
       "  'strip club brawls': 1,\n",
       "  'the Police Department': 4,\n",
       "  'the Detectives’ Endowment Association': 1,\n",
       "  'the City Council': 1,\n",
       "  'Brooklyn': 1,\n",
       "  'Disney': 15,\n",
       "  'the Art Institute of Chicago': 1,\n",
       "  'Matisse': 1,\n",
       "  'Warner Brothers': 3,\n",
       "  'New York University': 1,\n",
       "  'the Disney Family Museum': 1,\n",
       "  'the Otis Art Institute': 1,\n",
       "  'the Otis College of Art and Design': 1,\n",
       "  'the Works Progress Administration': 1,\n",
       "  'the Oriental Artists’ Group of Los Angeles': 1,\n",
       "  'Oriental Artists’ Group': 1,\n",
       "  'Hallmark': 1,\n",
       "  'a Disney Legend': 1,\n",
       "  'the Walt Disney Company': 1,\n",
       "  'the Chinese American Museum': 1,\n",
       "  'The Disney Family Museum’s': 1,\n",
       "  'the Museum of Chinese': 1,\n",
       "  'Jefferson Airplane Keith Emerson': 1,\n",
       "  'Gordie Howe': 1,\n",
       "  'the National Hockey League': 1,\n",
       "  'National League': 1,\n",
       "  'the National Basketball Association': 1,\n",
       "  'Negro': 1,\n",
       "  'the Hall of Fame': 1,\n",
       "  'Major League Baseball’s': 1,\n",
       "  'Supreme Court': 4,\n",
       "  'White House': 12,\n",
       "  'Senate': 69,\n",
       "  'Boutros': 1,\n",
       "  'the United Nations': 7,\n",
       "  'Auschwitz': 1,\n",
       "  'Snape': 1,\n",
       "  'Intel': 1,\n",
       "  'NBC': 20,\n",
       "  'Henry J. Heimlich': 1,\n",
       "  'Marion Pritchard': 1,\n",
       "  'the Constitutional Court': 1,\n",
       "  'the Sejong Institute': 1,\n",
       "  'Unha': 1,\n",
       "  'Musudan': 1,\n",
       "  'the United Nations Security Council': 1,\n",
       "  'Sandringham, Buckingham Palace': 1,\n",
       "  'Sandringham': 1,\n",
       "  'King Bhumibol Adulyadej of': 1,\n",
       "  'Democratic Progressive Party': 1,\n",
       "  'the Center for East Asia Policy Studies': 1,\n",
       "  'the Brookings Institution': 1,\n",
       "  'The Chinese Ministry of Foreign Affairs': 1,\n",
       "  'the National Institute of Diabetes and Digestive': 1,\n",
       "  'the National Institutes of Health': 1,\n",
       "  'the University of Washington': 1,\n",
       "  'Obesity': 1,\n",
       "  'the New Balance Foundation Obesity Prevention Center': 1,\n",
       "  'Boston Children’s Hospital': 1,\n",
       "  'Pfizer': 1,\n",
       "  'Australia’s': 1,\n",
       "  'National Health and Medical Research Council': 1,\n",
       "  'the University of Melbourne': 1,\n",
       "  'the “Biggest Loser': 1,\n",
       "  'Shower': 1,\n",
       "  'Harvard': 4,\n",
       "  'Columbia University': 1,\n",
       "  'Tigger': 1,\n",
       "  'HBO': 3,\n",
       "  'the College of William': 1,\n",
       "  'Aperture Music': 1,\n",
       "  'the University of Southern California': 1,\n",
       "  'Elle': 2,\n",
       "  'Target': 1,\n",
       "  'Fleetwood Mac': 1,\n",
       "  'the Colony Palms Hotel': 1,\n",
       "  'Instagram': 2,\n",
       "  'InStyle': 1,\n",
       "  'Colony Palms Hotel': 1,\n",
       "  'the Supreme Court’s': 1,\n",
       "  'Zoraida': 1,\n",
       "  'Muñizes': 1,\n",
       "  'Muñiz': 1,\n",
       "  'Catholic Charities Archdiocese': 1,\n",
       "  'The New York Times’s': 1,\n",
       "  'Neediest Cases Fund': 1,\n",
       "  'the Neediest Cases Fund': 1,\n",
       "  'the New York Film Academy’s': 1,\n",
       "  'Treasury': 3,\n",
       "  'Statoil': 1,\n",
       "  'the Republican Party': 2,\n",
       "  'the American Wind Energy Association': 1,\n",
       "  'the University of California at San Diego': 1,\n",
       "  'THOMPSONS': 1,\n",
       "  'NRG': 5,\n",
       "  'Nova': 1,\n",
       "  'Future Gen': 1,\n",
       "  'the Intergovernmental Panel on Climate Change': 1,\n",
       "  'the International Energy Agency': 1,\n",
       "  'the Lawrence Livermore Laboratories': 1,\n",
       "  'Energy Department': 2,\n",
       "  'the Environmental Defense Fund': 1,\n",
       "  'Net Power': 2,\n",
       "  'the Center for Climate and Energy Solutions': 1,\n",
       "  'CBI': 2,\n",
       "  'Toshiba': 1,\n",
       "  'RUD': 1,\n",
       "  'Sierra Club': 1,\n",
       "  'Groups': 1,\n",
       "  'Marjorie Meriweather Post': 1,\n",
       "  'Trump Tower': 2,\n",
       "  'MSNBC': 6,\n",
       "  'Newsmax Media': 1,\n",
       "  'Exxon Mobil': 2,\n",
       "  'the Department of Veteran Affairs': 1,\n",
       "  'Marvel Entertainment': 1,\n",
       "  'the New England Patriots': 1,\n",
       "  'Barron': 2,\n",
       "  'Secret Service': 1,\n",
       "  'Salad': 1,\n",
       "  'New Mexico State University': 1,\n",
       "  'Walgreens': 1,\n",
       "  'Costco': 1,\n",
       "  'Parabo Press': 2,\n",
       "  'Parabo': 1,\n",
       "  'SnapBox': 2,\n",
       "  'Tokyo Tower': 1,\n",
       "  'the Better Business Bureau': 1,\n",
       "  'The New York Times': 13,\n",
       "  'Memories Renewed': 2,\n",
       "  'Google Photos': 1,\n",
       "  'Metropolitan Transportation Authority': 1,\n",
       "  'New Yorker': 1,\n",
       "  'Federal District Court': 2,\n",
       "  'the Death Penalty Information Center': 1,\n",
       "  'North Charleston': 1,\n",
       "  'the African Methodist Episcopal Church': 1,\n",
       "  'the Justice Department': 2,\n",
       "  'Cornell Law School': 1,\n",
       "  'the Supreme Court': 4,\n",
       "  'MUMBAI': 1,\n",
       "  'Cornell University': 1,\n",
       "  'Satyagraha': 1,\n",
       "  'the University of Hong Kong': 2,\n",
       "  'Parliament': 6,\n",
       "  'the Observer Research Foundation': 1,\n",
       "  'the Indian National Congress': 1,\n",
       "  'the Observatory Group': 1,\n",
       "  'BAGHDAD': 1,\n",
       "  'The Islamic State': 2,\n",
       "  'ISIS': 4,\n",
       "  'The Environment Protection Authority': 1,\n",
       "  'Fahrenheit': 1,\n",
       "  'the Washington Redskins': 1,\n",
       "  'the Detroit Lions': 1,\n",
       "  'Giants': 7,\n",
       "  'Lions': 9,\n",
       "  'Fox Thanks': 1,\n",
       "  'ESPN': 1,\n",
       "  'CBS': 4,\n",
       "  'Tannehill': 1,\n",
       "  'Redskins': 1,\n",
       "  'the Oakland Raiders': 1,\n",
       "  'the Denver Broncos': 1,\n",
       "  'the Kansas City Chiefs’': 1,\n",
       "  'the San Diego Chargers': 1,\n",
       "  'The New England Patriots': 1,\n",
       "  'the Atlanta Falcons': 1,\n",
       "  'the Tampa Bay Buccaneers': 1,\n",
       "  'the Carolina Panthers': 1,\n",
       "  'Tampa Bay': 1,\n",
       "  'ABC': 8,\n",
       "  'Rockin’ Eve With Ryan Seacrest': 2,\n",
       "  'Us Weekly': 1,\n",
       "  'Maryland Sound International': 1,\n",
       "  'The Associated Press': 4,\n",
       "  'the Islamic State': 10,\n",
       "  'Palmyra': 1,\n",
       "  'Nimrud': 2,\n",
       "  'Time': 7,\n",
       "  'the Association for the Protection of Syrian Archaeology': 1,\n",
       "  'the “Eternal Sites': 1,\n",
       "  'YouTube': 3,\n",
       "  'British Vogue': 2,\n",
       "  'Cindy': 1,\n",
       "  'MTV': 3,\n",
       "  'Guido Palau': 1,\n",
       "  'the Affordable Care Act’s': 1,\n",
       "  'Medicare': 4,\n",
       "  'the Senate Finance Committee': 2,\n",
       "  'Reince Priebus': 2,\n",
       "  'Congressional Review Act': 1,\n",
       "  'the Senate Judiciary Committee': 1,\n",
       "  'the United States Supreme Court': 1,\n",
       "  'Republican Party': 2,\n",
       "  'the Tea Party': 1,\n",
       "  'Constitutional Court': 1,\n",
       "  'Choi': 1,\n",
       "  'Samsung': 1,\n",
       "  '• House': 1,\n",
       "  'India’s Supreme Court': 1,\n",
       "  'Bharatiya Janata Party': 1,\n",
       "  'Google': 6,\n",
       "  'Apple': 25,\n",
       "  'The New York Times] • Suicide': 1,\n",
       "  'Al Jazeera] •': 1,\n",
       "  'Quetta': 1,\n",
       "  'Reuters': 1,\n",
       "  'The New York Times] • Pan Pan': 1,\n",
       "  'The New York Times] •': 1,\n",
       "  'Quadrantids': 1,\n",
       "  'Rings': 1,\n",
       "  'OPEC': 1,\n",
       "  'the Emergency Highway Energy Conservation Act': 1,\n",
       "  'the Geneva Conventions': 3,\n",
       "  'Marine': 2,\n",
       "  'Army': 4,\n",
       "  'Senate Armed Services Committee': 1,\n",
       "  'the Joint Personnel Recovery Agency': 1,\n",
       "  'the C. I. A. ’s': 1,\n",
       "  'Red Cross': 1,\n",
       "  'the South Texas College of Law': 1,\n",
       "  'The Department of Defense': 1,\n",
       "  'Iraqi Army': 1,\n",
       "  'United States': 1,\n",
       "  'United States Army': 1,\n",
       "  'General Mattis': 1,\n",
       "  'Marines': 1,\n",
       "  'Marine Corps': 1,\n",
       "  'ISTANBUL': 2,\n",
       "  'the Foreign Ministry': 1,\n",
       "  'the Nashir Media Foundation': 1,\n",
       "  'Islamic State': 3,\n",
       "  'the National Security Council': 1,\n",
       "  'Taliban': 7,\n",
       "  'the Joint Chiefs of Staff': 4,\n",
       "  'Pentagon': 4,\n",
       "  'State Department': 4,\n",
       "  'the Johns Hopkins School of Advanced International Studies': 1,\n",
       "  'Al Qaeda': 2,\n",
       "  'the Pentagon’s Central Command': 1,\n",
       "  'the University of Chicago': 1,\n",
       "  'General Petraeus': 2,\n",
       "  'the American Embassy': 2,\n",
       "  'Navy': 4,\n",
       "  'Air Force': 2,\n",
       "  'National Security Council': 1,\n",
       "  'ISIL': 1,\n",
       "  'Afghan Army': 1,\n",
       "  'the United States Military Academy': 1,\n",
       "  'NATO': 4,\n",
       "  'MacArthur': 1,\n",
       "  'the Organizing Goddess': 1,\n",
       "  'Organize With Faith': 1,\n",
       "  'The Ministry of Justice': 1,\n",
       "  'Lahav 433': 1,\n",
       "  'Haaretz': 1,\n",
       "  'Likud Party': 1,\n",
       "  'a United Nations Security Council': 1,\n",
       "  'Yedioth Ahronoth': 1,\n",
       "  'the Zionist Union': 1,\n",
       "  'Likud': 1,\n",
       "  'Netanyahus': 1,\n",
       "  'universal health care': 1,\n",
       "  'Monoprix': 1,\n",
       "  'Lyon': 1,\n",
       "  'Miroslav Gronych': 1,\n",
       "  'the Calgary Police Service': 1,\n",
       "  'the Calgary Police Service’s': 1,\n",
       "  'Transport Canada': 1,\n",
       "  'Sunwing Airlines': 1,\n",
       "  'RIO DE JANEIRO': 1,\n",
       "  'Amazon': 7,\n",
       "  'Manaus': 6,\n",
       "  'Facebook': 4,\n",
       "  'First Capital Command': 1,\n",
       "  'Amazonas State': 1,\n",
       "  'the First Capital Command': 1,\n",
       "  'Carandiru': 1,\n",
       "  'Umanizzare': 1,\n",
       "  'Red Command': 1,\n",
       "  'Space Exploration Technologies Corporation': 1,\n",
       "  'Cape Canaveral Air Force Station': 1,\n",
       "  'the Federal Aviation Administration': 1,\n",
       "  'NASA': 3,\n",
       "  'the National Transportation Safety Board': 2,\n",
       "  'the International Space Station': 1,\n",
       "  'Department of Defense': 1,\n",
       "  'SpaceX': 1,\n",
       "  'CNBC': 2,\n",
       "  'Iridium Communications': 1,\n",
       "  'Iridium': 2,\n",
       "  'Vandenberg Air Force Base': 1,\n",
       "  'the Yeshiva University High School for Boys': 2,\n",
       "  'Dungeon': 1,\n",
       "  'the Salanter Akiba Riverdale High School': 1,\n",
       "  'Sabbath': 1,\n",
       "  'the Frisch School': 2,\n",
       "  'the Ramaz School': 2,\n",
       "  'the Israeli Army': 2,\n",
       "  'The Ramaz School': 1,\n",
       "  'the Rams of Ramaz': 1,\n",
       "  'the Rav Teitz Mesivta Academy': 1,\n",
       "  'Flatbush': 1,\n",
       "  'the Yeshivat Darche Eres': 1,\n",
       "  'MSG Networks': 1,\n",
       "  'Towns': 1,\n",
       "  'the Hebrew Academy of': 1,\n",
       "  'Rockaway': 1,\n",
       "  'the Hebrew Academy': 1,\n",
       "  'the Metropolitan Yeshiva High School Athletic League': 1,\n",
       "  'Yeshiva University High School': 1,\n",
       "  'Ramones': 1,\n",
       "  'Rangers': 2,\n",
       "  'Frisch': 1,\n",
       "  'The Beinecke Rare Book  Manuscript Library': 1,\n",
       "  'Yale University': 1,\n",
       "  'Sinclair Lewis': 1,\n",
       "  'Yale': 3,\n",
       "  'Pomona College': 1,\n",
       "  'Bennington College': 1,\n",
       "  'Tourette': 2,\n",
       "  'MaryGwen': 1,\n",
       "  'Canunayons': 2,\n",
       "  'St. Adalbert Roman Catholic Church': 1,\n",
       "  'the Roman Catholic Diocese': 1,\n",
       "  'Community Health Advocates': 1,\n",
       "  'the Community Service Society': 1,\n",
       "  'The New York Times Neediest Cases Fund': 2,\n",
       "  'The Community Service Society': 1,\n",
       "  'the Office of Congressional Ethics': 8,\n",
       "  'House Ethics Committee': 1,\n",
       "  'The House Ethics Committee': 1,\n",
       "  'the Ethics Committee': 5,\n",
       "  'The Office of Congressional Ethics': 1,\n",
       "  'the House Judiciary Committee': 1,\n",
       "  'Citizens for Responsibility and Ethics': 1,\n",
       "  'General Motors': 6,\n",
       "  'Ford': 5,\n",
       "  'the California Legislature': 2,\n",
       "  'Fox News': 15,\n",
       "  'Aravind Adiga’s': 1,\n",
       "  'Titanic': 14,\n",
       "  'Houses': 1,\n",
       "  'Eastern': 1,\n",
       "  'Capitol': 1,\n",
       "  'the Budget Committee': 2,\n",
       "  'the Senate Budget Committee': 1,\n",
       "  'The American Medical Association': 1,\n",
       "  'the Judiciary Committee': 1,\n",
       "  'Chevrolet': 2,\n",
       "  'the North American Free Trade Agreement': 1,\n",
       "  'Goldman Sachs': 9,\n",
       "  'the National Economic Council Rex W. Tillerson': 1,\n",
       "  'White  Case': 1,\n",
       "  'Chevy': 1,\n",
       "  'Cruze': 1,\n",
       "  'Ford Focus': 1,\n",
       "  'Omarosa Manigault': 1,\n",
       "  'the Ecuadorean Embassy': 1,\n",
       "  'the Democratic National Committee': 3,\n",
       "  'DCLeaks': 2,\n",
       "  'the D. N. C. and Podesta': 1,\n",
       "  'the Senate Armed Services Committee': 2,\n",
       "  'CNN': 7,\n",
       "  'the White House Office of Public Liaison': 1,\n",
       "  'Oval Office': 1,\n",
       "  'the Office of Legislative Affairs': 1,\n",
       "  'the Office of Intergovernmental Affairs': 1,\n",
       "  'Cabinet Affairs': 1,\n",
       "  'the Republican National Committee under Reince Priebus': 1,\n",
       "  'the Office of Public Liaison': 1,\n",
       "  'Medicaid': 7,\n",
       "  'the Securities and Exchange Commission': 3,\n",
       "  'Legislature': 4,\n",
       "  'Assembly': 2,\n",
       "  'Trump White House': 1,\n",
       "  'The Democratic Party': 1,\n",
       "  'Covington  Burling': 1,\n",
       "  'Covington': 1,\n",
       "  'the Israel Defense Forces': 1,\n",
       "  'the I. D. F.': 1,\n",
       "  'the Hebrew University of Jerusalem': 1,\n",
       "  'the Labor Party': 1,\n",
       "  'Azaria': 1,\n",
       "  'Sergeant Azaria’s': 1,\n",
       "  'the Israeli Parliament': 1,\n",
       "  'the International Journal of Behavioral Nutrition and Physical Activity': 1,\n",
       "  'the University of Colorado Anschutz Medical Campus': 1,\n",
       "  'the Johnson  Johnson Human Performance Institute': 2,\n",
       "  'the Colorado Nutrition Obesity Research Center': 1,\n",
       "  'Forbes': 1,\n",
       "  'Money': 1,\n",
       "  'Barron’s': 1,\n",
       "  'Vanguard’s Total Stock': 1,\n",
       "  'Kennametal': 1,\n",
       "  'Burlington Stores': 1,\n",
       "  'NBC News': 7,\n",
       "  'Fox News’s': 2,\n",
       "  'Greta Van Susteren': 1,\n",
       "  'Fox': 14,\n",
       "  'Fox’s': 4,\n",
       "  'ABC News': 1,\n",
       "  'The Wall Street Journal': 4,\n",
       "  'NBC Universal': 1,\n",
       "  'Oprah': 1,\n",
       "  'the National Football League': 1,\n",
       "  'NBC News’s': 1,\n",
       "  'Fox Business Network Shannon Bream': 1,\n",
       "  'Kimberly Guilfoyle': 1,\n",
       "  'Evergrande Football School': 1,\n",
       "  'Chelsea': 1,\n",
       "  'the University of Salford': 1,\n",
       "  'People’s Daily': 1,\n",
       "  'the Communist Party': 1,\n",
       "  'Wild East Football': 1,\n",
       "  'FIFA': 1,\n",
       "  'the Women’s World Cup': 1,\n",
       "  'Chinese Super League': 1,\n",
       "  'Premier League': 1,\n",
       "  'the Bayi School': 1,\n",
       "  'Caoqiao Elementary School': 1,\n",
       "  'IBM': 1,\n",
       "  'Yahoo': 1,\n",
       "  'Microsoft': 3,\n",
       "  'Alphabet, Google’s': 1,\n",
       "  'Alphabet’s': 1,\n",
       "  'Airbnb, Uber and Snap': 1,\n",
       "  'the Federal Bureau of Investigation': 2,\n",
       "  'iPhone': 6,\n",
       "  'iPhones': 1,\n",
       "  'The Washington Post': 3,\n",
       "  'the Federal Communications Commission': 1,\n",
       "  'the Carlyle Group': 1,\n",
       "  'Next Big Thing': 1,\n",
       "  'Communist Party': 2,\n",
       "  'the city party committee': 1,\n",
       "  'Sichuan Daily': 1,\n",
       "  'the John Jay College': 1,\n",
       "  'Criminal Justice': 1,\n",
       "  'The New York Police Department': 1,\n",
       "  'Detective Bureau': 1,\n",
       "  'The   Club for Growth': 1,\n",
       "  'New York         ': 1,\n",
       "  'American Life': 1,\n",
       "  'the Montauk Point Lighthouse': 1,\n",
       "  'Organizing for Action': 1,\n",
       "  'Champagne': 2,\n",
       "  'the New York City Department of City Planning': 1,\n",
       "  'the Metropolitan Transportation Authority': 3,\n",
       "  'Overboard': 1,\n",
       "  'Park Slope': 1,\n",
       "  'OkCupid': 1,\n",
       "  'Jumbotron': 1,\n",
       "  'the NoMad Hotel': 1,\n",
       "  'the George Washington Bridge': 1,\n",
       "  'Plaza College': 1,\n",
       "  'Metropolitan College': 1,\n",
       "  'Joaquin': 2,\n",
       "  'the Knowledge and Power Preparatory Academy': 1,\n",
       "  'Fordham University': 1,\n",
       "  'the Family Assistance Program': 1,\n",
       "  'Children’s Aid': 1,\n",
       "  'The Children’s Aid Society': 1,\n",
       "  'the Congressional Research Service': 1,\n",
       "  'the Congressional Budget and Impoundment Control': 1,\n",
       "  'The Omnibus Budget Reconciliation Act': 1,\n",
       "  'Social Security': 2,\n",
       "  'the Balanced Budget Act': 1,\n",
       "  'the Children’s Health Insurance Program': 1,\n",
       "  'the Select Committee on Ethics': 1,\n",
       "  'Irina': 1,\n",
       "  'Washingtonian': 1,\n",
       "  'Washington Fine Properties': 1,\n",
       "  'the Podesta Group': 1,\n",
       "  'The white house': 1,\n",
       "  'the Secret Service': 1,\n",
       "  'Rapoport Capital': 1,\n",
       "  'Georgetown': 1,\n",
       "  'Barclays Capital': 1,\n",
       "  'Lehman Brothers': 1,\n",
       "  'Bear Stearns': 1,\n",
       "  'JPMorgan Chase': 4,\n",
       "  'Alibaba Group of China': 1,\n",
       "  'Debevoise  Plimpton': 1,\n",
       "  'Bank of America': 1,\n",
       "  'Goldman’s': 1,\n",
       "  'Goldman': 3,\n",
       "  'Goldman’s No': 1,\n",
       "  'Trump’s': 1,\n",
       "  'Capital Management': 1,\n",
       "  'Sullivan  Cromwell': 2,\n",
       "  'Davis Polk’s': 1,\n",
       "  'the S. E. C.': 1,\n",
       "  'the University of Pennsylvania': 2,\n",
       "  'the University of Cambridge': 1,\n",
       "  'the University of Pennsylvania Law School': 1,\n",
       "  'Morgan Stanley': 1,\n",
       "  'Justice Department': 1,\n",
       "  'Malana': 1,\n",
       "  'Reformed Episcopal Church': 1,\n",
       "  'the Gospel of Mark': 1,\n",
       "  'CIA': 1,\n",
       "  'Cumhuriyet': 1,\n",
       "  'Santa Claus': 1,\n",
       "  'Islam': 1,\n",
       "  'the Washington Institute for Near East Policy': 1,\n",
       "  'Hezbollah': 1,\n",
       "  'The Syrian Observatory for Human Rights': 1,\n",
       "  'eastern': 1,\n",
       "  'United Nations': 5,\n",
       "  'Matilda': 1,\n",
       "  'Kwakiutl': 3,\n",
       "  'First Nations': 2,\n",
       "  'the Royal Canadian Navy': 1,\n",
       "  'Quakers': 3,\n",
       "  'Grindstone': 4,\n",
       "  'Moonwatcher’s Point': 1,\n",
       "  'the Electronic Frontier Foundation': 2,\n",
       "  'Hawker Siddeley HS': 1,\n",
       "  'Hawker': 1,\n",
       "  'Yukon': 2,\n",
       "  'German Mennonites': 1,\n",
       "  'Oma and Opa': 1,\n",
       "  'Oma and Opa’s': 1,\n",
       "  'Mercedes': 3,\n",
       "  'BB': 1,\n",
       "  'Pigs': 1,\n",
       "  'Adult Magazine': 1,\n",
       "  'Melville': 1,\n",
       "  'the Québécois Mystic': 1,\n",
       "  'Cavalier': 2,\n",
       "  'beech': 1,\n",
       "  'un': 4,\n",
       "  'Cette': 1,\n",
       "  'une ville homonyme aux   ': 1,\n",
       "  'il y avait': 1,\n",
       "  'dans un musée': 1,\n",
       "  'une salle dédiée': 1,\n",
       "  'J’inventais d’ores': 1,\n",
       "  'entre moi prenant des': 1,\n",
       "  'une': 4,\n",
       "  'pensais à la fuite des loyalistes': 1,\n",
       "  'Abénaquis des Premières Nations': 1,\n",
       "  'qui': 1,\n",
       "  'j’étais': 1,\n",
       "  'Je': 2,\n",
       "  'dans le bureau du tourisme': 1,\n",
       "  'grandeur veillaient sur les': 1,\n",
       "  'Travel': 1,\n",
       "  'Banff': 1,\n",
       "  'Mounties': 1,\n",
       "  '360 News': 1,\n",
       "  'Summerfest': 1,\n",
       "  'Henry Maier Festival Park': 1,\n",
       "  'The Red Hot Chili Peppers': 1,\n",
       "  'The Monterey International Pop Festival': 1,\n",
       "  'the Mustique Blues Festival': 1,\n",
       "  'the Vienna Philharmonic': 1,\n",
       "  'Elbphilharmonie': 1,\n",
       "  'Viva Beethoven': 1,\n",
       "  'Brightline': 1,\n",
       "  'MiamiCentral': 1,\n",
       "  'Alps': 1,\n",
       "  'Lugano': 1,\n",
       "  'Belmond Andean Explorer': 1,\n",
       "  'Cusco': 2,\n",
       "  'Lake Titicaca': 1,\n",
       "  'Arequipa': 1,\n",
       "  'Hokkaido': 2,\n",
       "  'Celebrity Cruises': 1,\n",
       "  'the Celebrity Xploration': 1,\n",
       "  'National Geographic Quest': 1,\n",
       "  'Star Clippers': 1,\n",
       "  'Flying Clipper': 1,\n",
       "  'Uniworld Boutique River Cruise Collection': 1,\n",
       "  'Crystal River Cruises': 1,\n",
       "  'Crystal': 1,\n",
       "  'Boeing': 1,\n",
       "  'Peninsula Hotels': 1,\n",
       "  'Newfoundland': 2,\n",
       "  'Wilson': 3,\n",
       "  'Manhattan Theater Club': 1,\n",
       "  'the Signature Theater': 1,\n",
       "  'the Sydney Theater Company': 1,\n",
       "  'Platonov': 1,\n",
       "  'Irish Rep': 1,\n",
       "  'the Irish Repertory Theater': 1,\n",
       "  'the Public Theater': 1,\n",
       "  'the Druid Theater': 1,\n",
       "  'the Brooklyn Academy of Music': 1,\n",
       "  'the Association for a Better New York': 1,\n",
       "  'the Port Authority of New York': 1,\n",
       "  'the Port Authority': 1,\n",
       "  'Newark Liberty International Airport': 1,\n",
       "  'AirTrain': 2,\n",
       "  'JetBlue Airways': 1,\n",
       "  'Delta Air Lines': 1,\n",
       "  'the Central Terminal Building': 1,\n",
       "  'the Van Wyck Expressway': 1,\n",
       "  'PAN': 4,\n",
       "  'Lagunes': 3,\n",
       "  'Nieto': 1,\n",
       "  'PRI': 1,\n",
       "  'Moreno Valle’s': 3,\n",
       "  'Madero': 2,\n",
       "  'Cordero': 3,\n",
       "  'Hacking Team  ': 1,\n",
       "  'Podesta': 7,\n",
       "  'Sony': 5,\n",
       "  'Hacking Team': 35,\n",
       "  'Insider Surveillance': 1,\n",
       "  'FinFisher': 1,\n",
       "  'Trovicor': 1,\n",
       "  'the National Security Agency': 3,\n",
       "  'the Remote Control System': 11,\n",
       "  'Skype': 4,\n",
       "  'the Drug Enforcement Administration': 1,\n",
       "  'Puebla, Hacking Team': 1,\n",
       "  'Hacking Team’s': 24,\n",
       "  'LEAs': 1,\n",
       "  'Hacked Team': 1,\n",
       "  'pdf': 1,\n",
       "  'Passw0rd': 1,\n",
       "  'the Hacked Team': 5,\n",
       "  'Dell': 1,\n",
       "  'BlackBerry': 1,\n",
       "  'Android': 1,\n",
       "  'Microsoft Word': 1,\n",
       "  'PowerPoint': 1,\n",
       "  'Page’s Gmail': 1,\n",
       "  'Page': 2,\n",
       "  'Vinci': 1,\n",
       "  'Vincenzetti': 7,\n",
       "  'Tron': 1,\n",
       "  'the University of Milan': 1,\n",
       "  'The United Nations': 1,\n",
       "  'the Italian Parliament': 1,\n",
       "  'the European Union': 1,\n",
       "  'i. e.': 1,\n",
       "  'the University of Toronto’s Munk School of Global Affairs': 1,\n",
       "  'Peña Nieto’s': 1,\n",
       "  'Ernesto Aroche': 1,\n",
       "  'Puebla’s': 2,\n",
       "  'Aroche': 9,\n",
       "  'Sym Servicios Integrales': 2,\n",
       "  'Sagrario Conde Valerio': 1,\n",
       "  '‘Hacking Team': 1,\n",
       "  'The Hacked Team': 1,\n",
       "  'the Department of Justice': 2,\n",
       "  'the Royal Canadian Mounted Police': 1,\n",
       "  'Kleiner Perkins Caufield Byers': 1,\n",
       "  'the Harris Corporation': 1,\n",
       "  'the New York Stock Exchange': 1,\n",
       "  'Hailstorm': 2,\n",
       "  'the Internal Revenue Service': 1,\n",
       "  'the Democratic Party': 1,\n",
       "  'the Bureau of Labor Statistics': 1,\n",
       "  'Johns Hopkins': 1,\n",
       "  'the University of Akron': 1,\n",
       "  'World Trade Center': 1,\n",
       "  'The Financial Times': 1,\n",
       "  'the New York Times': 2,\n",
       "  'the Cyberspace Administration of China': 1,\n",
       "  'Provisions on the Administration of Mobile Internet Application Information Services': 1,\n",
       "  'the Center for Comparative and Public Law': 1,\n",
       "  'Sinosphere': 1,\n",
       "  'Apple’s iBooks Store': 1,\n",
       "  'Marbridge Consulting': 1,\n",
       "  'Federal Reserve': 1,\n",
       "  'Fed': 19,\n",
       "  'Barclays': 1,\n",
       "  'TD Bank': 1,\n",
       "  'the Federal Open Market Committee': 1,\n",
       "  'Navy Federal Credit Union': 1,\n",
       "  'the Federal Reserve Bank': 1,\n",
       "  'the Rockefeller Foundation': 4,\n",
       "  'the United States Agency': 1,\n",
       "  'International Development': 1,\n",
       "  'the American Red Cross': 1,\n",
       "  'Latitude Capital': 1,\n",
       "  'the Gates Foundation': 1,\n",
       "  'Rockefeller Foundation': 1,\n",
       "  'Rockefeller': 1,\n",
       "  'The Rockefeller Foundation': 1,\n",
       "  'the Clinton Foundation': 2,\n",
       "  'Mindanao': 2,\n",
       "  'the Philippine Bureau of Jail Management and Penology': 1,\n",
       "  'the Moro Islamic Liberation Front': 1,\n",
       "  'the Bangsamoro Islamic Freedom Fighters': 1,\n",
       "  'Xinhua': 3,\n",
       "  'the state news agency': 1,\n",
       "  'the Ministry of Foreign Affairs': 1,\n",
       "  'DORAL': 1,\n",
       "  'Carnival Corporation': 1,\n",
       "  'Walt Disney World': 1,\n",
       "  'Carnival': 18,\n",
       "  'the Consumer Electronics Show': 1,\n",
       "  'Princess Cruises': 1,\n",
       "  'Trident': 1,\n",
       "  'Royal Caribbean Cruises': 1,\n",
       "  'WOW': 1,\n",
       "  'the Cruise Lines International Association': 1,\n",
       "  'Bernstein Research': 1,\n",
       "  'CW': 1,\n",
       "  'UBS': 1,\n",
       "  'Brooks': 1,\n",
       "  'the Promenade Deck': 1,\n",
       "  'Disney World': 1,\n",
       "  'TransUnion': 8,\n",
       "  'Equifax': 7,\n",
       "  'the Consumer Financial Protection Bureau': 2,\n",
       "  'Ines Gutzmer': 1,\n",
       "  'Channel 4': 1,\n",
       "  'the Smithsonian Channel': 1,\n",
       "  'Wolff’s': 1,\n",
       "  'Imperial College London': 1,\n",
       "  'Tutankhamen': 1,\n",
       "  'The Irish Daily Mail': 1,\n",
       "  'fed': 1,\n",
       "  'the British Titanic Society': 1,\n",
       "  'Chase Sapphire Reserve': 1,\n",
       "  'Points': 1,\n",
       "  'Lyceum': 1,\n",
       "  'the Broadway League': 2,\n",
       "  'NYC  Company': 1,\n",
       "  'LECCE': 1,\n",
       "  'Lecce Penitentiary': 2,\n",
       "  'chardonnay': 1,\n",
       "  'the University of Turin': 1,\n",
       "  'the Bocconi University': 1,\n",
       "  'Salento': 1,\n",
       "  'Alex (Marcel Ruiz': 1,\n",
       "  'Netflix': 1,\n",
       "  'Whitney Blake’s': 1,\n",
       "  'Mackenzie Phillips': 1,\n",
       "  'Lydia': 2,\n",
       "  'the Department of Veterans Affairs': 1,\n",
       "  'Penelope’s': 1,\n",
       "  'Ben’s Chili Bowl': 1,\n",
       "  'the United Negro College Fund': 2,\n",
       "  'Condé Nast Publications': 1,\n",
       "  'Vanity Fair': 3,\n",
       "  'The New Yorker': 1,\n",
       "  'Vogue': 10,\n",
       "  'Architectural Digest': 2,\n",
       "  'Condé Nast’s': 1,\n",
       "  'One World Trade Center in Lower Manhattan': 1,\n",
       "  'SOCO Gallery': 1,\n",
       "  'Arthur Elgort': 1,\n",
       "  'The New Yorker’s': 1,\n",
       "  'Julian Assange': 4,\n",
       "  'WikiLeaks': 1,\n",
       "  'The Democratic National Committee': 1,\n",
       "  'FBI': 1,\n",
       "  'BuzzFeed': 1,\n",
       "  'the Marine Corps': 1,\n",
       "  'the Senate Intelligence Committee': 1,\n",
       "  'United States Cyber Command': 2,\n",
       "  'Intelligence Committee': 1,\n",
       "  'the Intelligence Committee': 2,\n",
       "  'the Defense Intelligence Agency': 1,\n",
       "  'the C. I. A.': 3,\n",
       "  'Wheaton College': 1,\n",
       "  'the Indiana University': 1,\n",
       "  'the Senate Armed Services and': 1,\n",
       "  'Intelligence Committees': 1,\n",
       "  'the D. N. C.': 10,\n",
       "  'the State Department': 3,\n",
       "  'Kremlin': 1,\n",
       "  'The Times of the Russian': 1,\n",
       "  'The D. N. C. ’s': 1,\n",
       "  'the Democratic Congressional Campaign Committee': 4,\n",
       "  'the Center for American Progress': 1,\n",
       "  'the Russian Foreign Ministry': 1,\n",
       "  'GOP': 1,\n",
       "  'Bugging Affair': 1,\n",
       "  'The D. N. C.': 1,\n",
       "  'The MIS Department': 1,\n",
       "  'SA Hawkins': 1,\n",
       "  'the D. N. C. ’s': 6,\n",
       "  'CrowdStrike Services': 1,\n",
       "  'the Colorado School of Mines': 1,\n",
       "  'King’s College': 1,\n",
       "  'the Department of Energy': 1,\n",
       "  'the Air Force': 1,\n",
       "  'the Washington Monument': 1,\n",
       "  'FireEye': 1,\n",
       "  'Defense': 1,\n",
       "  'the Carnegie Endowment': 1,\n",
       "  'The State Department': 2,\n",
       "  'State': 3,\n",
       "  'The Open Society Foundation': 1,\n",
       "  'the White House Correspondents’ Association': 1,\n",
       "  'CrowdStrike': 10,\n",
       "  'Cozy Bear': 1,\n",
       "  'Google Translate': 1,\n",
       "  'the Republican National Convention': 1,\n",
       "  'the Democratic National Convention': 1,\n",
       "  'the Department of Homeland Security': 1,\n",
       "  'Sony Pictures Entertainment': 1,\n",
       "  'Situation Room': 1,\n",
       "  'the Tailored Access Operations': 1,\n",
       "  'the Pentagon’s Cyber Command': 1,\n",
       "  'Avril Haines': 1,\n",
       "  'the Republican National Committee': 1,\n",
       "  'Harvard University': 1,\n",
       "  'the International Rehabilitation Council for Torture Victims': 1,\n",
       "  'the Americas for Human Rights Watch': 1,\n",
       "  'the University of Oslo': 1,\n",
       "  'the United Nations Committee Against Torture': 1,\n",
       "  'Truth': 1,\n",
       "  'Dignity Commission': 1,\n",
       "  'the African Center for Treatment and': 1,\n",
       "  'CAPS': 1,\n",
       "  'the Committee Against Torture': 1,\n",
       "  'the Medical Action Group': 1,\n",
       "  'House Energy and Commerce': 1,\n",
       "  'House Ways and Means': 1,\n",
       "  'Senate Finance': 1,\n",
       "  'Senate Health': 1,\n",
       "  'Education': 1,\n",
       "  'Labor': 1,\n",
       "  'the Congressional Budget Act': 1,\n",
       "  'the American Cancer Society': 1,\n",
       "  'the American Heart Association': 1,\n",
       "  'the Center on Budget and Policy Priorities': 1,\n",
       "  'the Commonwealth Fund': 1,\n",
       "  'the Urban Institute': 1,\n",
       "  'the American Academy of Diplomacy': 1,\n",
       "  'Foreign Service': 1,\n",
       "  'the Middle East Institute': 1,\n",
       "  'Occidental College': 1,\n",
       "  'the Cohen Group': 1,\n",
       "  'the Trump Organization': 1,\n",
       "  'TALLADEGA': 1,\n",
       "  'Talladega College': 4,\n",
       "  'the Radio City Rockettes': 1,\n",
       "  'the United Church of Christ': 1,\n",
       "  'the University of South Carolina': 1,\n",
       "  'Planned Parenthood': 1,\n",
       "  'Big Mac’s': 1,\n",
       "  'the Talladega College': 1,\n",
       "  'the Commodity Futures Trading Commission': 3,\n",
       "  'Aitan Goelman': 1,\n",
       "  'MF Global’s': 2,\n",
       "  'the Financial Industry Regulatory Authority': 1,\n",
       "  'the Commodity Futures Trading Commission’s': 1,\n",
       "  'JPMorgan': 2,\n",
       "  'Covenant House': 1,\n",
       "  'Sears Holdings': 1,\n",
       "  'Stanley Black  Decker’s': 1,\n",
       "  'Sears': 16,\n",
       "  'Macy': 8,\n",
       "  'Kohl’s': 1,\n",
       "  'Kmart': 1,\n",
       "  'Moody’s': 1,\n",
       "  'Citigroup': 1,\n",
       "  'Craftsman': 2,\n",
       "  'DieHard': 1,\n",
       "  'Deutsche Bank': 1,\n",
       "  'Newell Brands': 1,\n",
       "  'Stanley Black  Decker': 1,\n",
       "  'A Long Island Rail Road': 1,\n",
       "  'Atlantic Terminal': 1,\n",
       "  'the Federal Railroad Administration': 1,\n",
       "  'Chrysler': 2,\n",
       "  'Kelley Blue Book': 1,\n",
       "  'IHS Markit': 1,\n",
       "  'Ford Motor': 1,\n",
       "  'Fiat Chrysler': 2,\n",
       "  'the Dodge Dart': 1,\n",
       "  'Jeep': 1,\n",
       "  'Toyota': 1,\n",
       "  'Chevrolet Bolts': 1,\n",
       "  'Bloomingdale’s': 1,\n",
       "  'Macy’s': 1},\n",
       " 'MONEY': {'billions of dollars': 5,\n",
       "  'an estimated $13 billion': 1,\n",
       "  '115': 1,\n",
       "  'about $700': 1,\n",
       "  '50 cents': 1,\n",
       "  '90': 1,\n",
       "  'about $770': 1,\n",
       "  '245': 1,\n",
       "  '600': 2,\n",
       "  '$42 million': 1,\n",
       "  'more than $300 billion': 1,\n",
       "  '$80 billion': 1,\n",
       "  '$190 million': 1,\n",
       "  'about $50': 1,\n",
       "  'more than $1 billion': 3,\n",
       "  '$140 million': 1,\n",
       "  'the billions of dollars': 3,\n",
       "  'less than $10 million': 1,\n",
       "  '500': 2,\n",
       "  '20': 1,\n",
       "  '25': 1,\n",
       "  'less than $2': 1,\n",
       "  'about $80': 1,\n",
       "  '34': 1,\n",
       "  '65': 1,\n",
       "  '145': 1,\n",
       "  '259': 1,\n",
       "  'an additional $15': 1,\n",
       "  '60 cents': 1,\n",
       "  '10': 2,\n",
       "  '15': 2,\n",
       "  '150': 1,\n",
       "  'about $4': 1,\n",
       "  'about $8 and $15': 1,\n",
       "  'about $3': 1,\n",
       "  'about $15': 1,\n",
       "  '100': 3,\n",
       "  'an estimated $20': 1,\n",
       "  '200': 1,\n",
       "  '$30 million': 1,\n",
       "  '$100 million': 1,\n",
       "  'more than 37 million': 1,\n",
       "  '$200 million': 2,\n",
       "  '641': 1,\n",
       "  'millions of dollars': 3,\n",
       "  'about $1': 1,\n",
       "  '2': 5,\n",
       "  'tens of millions': 3,\n",
       "  'more than $20 million': 1,\n",
       "  '$20 million': 1,\n",
       "  '$15 million': 1,\n",
       "  'a penny': 1,\n",
       "  'as much as $40 million': 1,\n",
       "  '$105 million': 1,\n",
       "  'hundreds of millions of dollars': 2,\n",
       "  'about $300 million': 1,\n",
       "  'nearly $120 million': 1,\n",
       "  'about $8': 1,\n",
       "  'about $119': 1,\n",
       "  'roughly $1': 1,\n",
       "  'about $100': 1,\n",
       "  '216': 1,\n",
       "  '506': 1,\n",
       "  '308': 1,\n",
       "  '413': 1,\n",
       "  '49': 2,\n",
       "  'tens of billions of dollars': 2,\n",
       "  '5': 2,\n",
       "  '$25 billion': 1,\n",
       "  '$5 billion': 1,\n",
       "  '1': 9,\n",
       "  'more than $100 million': 1,\n",
       "  '$400 million': 1,\n",
       "  '52Places2017': 1,\n",
       "  '159': 1,\n",
       "  'more than $10 billion': 1,\n",
       "  '$30 billion': 1,\n",
       "  'only about $1 billion': 1,\n",
       "  'up to $7 billion': 1,\n",
       "  '$600 million': 1,\n",
       "  'about $4 billion': 1,\n",
       "  '$4 billion': 1,\n",
       "  'as much as $2 billion': 1,\n",
       "  'as little as $200': 1,\n",
       "  'more than $700': 1,\n",
       "  'more than $1 million': 2,\n",
       "  '$13 billion': 1,\n",
       "  '#JeSuisCharlie': 1,\n",
       "  '18': 1,\n",
       "  'roughly $200 million': 1,\n",
       "  'more than $17 billion': 1,\n",
       "  '$1 billion': 1,\n",
       "  'a record $1': 1,\n",
       "  'more than $23': 1,\n",
       "  'only $1': 1,\n",
       "  'more than $200': 1,\n",
       "  '13': 1,\n",
       "  '$3 million': 2,\n",
       "  '3': 4,\n",
       "  '4': 1,\n",
       "  '$200 million to $300 million': 1,\n",
       "  '450': 1,\n",
       "  '300': 1,\n",
       "  '911': 1,\n",
       "  'more than $2 million': 1,\n",
       "  '310': 1,\n",
       "  '998': 1,\n",
       "  '815': 1,\n",
       "  '$25 million': 2,\n",
       "  '95': 1,\n",
       "  '325': 1,\n",
       "  'at least $1 billion': 1,\n",
       "  'more than $60': 1,\n",
       "  '$5 million': 3,\n",
       "  'more than $775 million': 1,\n",
       "  '$258 million': 1,\n",
       "  'up to $1 billion': 1,\n",
       "  '$500 million': 1,\n",
       "  '$525 million': 1,\n",
       "  'an additional $250 million': 1,\n",
       "  '$900 million': 1,\n",
       "  'nearly $1 billion': 1,\n",
       "  '35': 1,\n",
       "  'about $550 million': 1,\n",
       "  '95 to $3': 1,\n",
       "  '15 to $3': 1,\n",
       "  '32': 1},\n",
       " 'CARDINAL': {'millions': 7,\n",
       "  'two': 91,\n",
       "  'four': 21,\n",
       "  'five': 13,\n",
       "  '77': 1,\n",
       "  'Nine': 2,\n",
       "  '14': 3,\n",
       "  '1': 19,\n",
       "  '300': 6,\n",
       "  'one': 122,\n",
       "  'more than one': 2,\n",
       "  '911': 4,\n",
       "  'nine': 10,\n",
       "  'as half': 1,\n",
       "  'hundreds': 7,\n",
       "  '83': 1,\n",
       "  '184': 1,\n",
       "  'more than a third': 3,\n",
       "  'three': 40,\n",
       "  '17': 10,\n",
       "  '72': 2,\n",
       "  '343': 1,\n",
       "  '18': 2,\n",
       "  '276': 1,\n",
       "  '521': 1,\n",
       "  '19': 3,\n",
       "  'Four': 3,\n",
       "  'more than a dozen': 3,\n",
       "  '25 911': 1,\n",
       "  'Several dozen': 1,\n",
       "  'Three': 6,\n",
       "  'more than 400': 1,\n",
       "  '150': 4,\n",
       "  '79': 2,\n",
       "  '16': 9,\n",
       "  '65': 2,\n",
       "  '58': 2,\n",
       "  '27': 1,\n",
       "  '38': 2,\n",
       "  '25': 2,\n",
       "  '36': 1,\n",
       "  '000': 53,\n",
       "  'only a tenth': 1,\n",
       "  'about eight': 1,\n",
       "  'about 11': 1,\n",
       "  'One': 34,\n",
       "  '2': 23,\n",
       "  'about two': 1,\n",
       "  '106': 3,\n",
       "  'dozens': 13,\n",
       "  'half': 7,\n",
       "  'thousands': 10,\n",
       "  'Seven': 1,\n",
       "  '960': 1,\n",
       "  'tens of thousands': 5,\n",
       "  '52': 4,\n",
       "  'eight': 9,\n",
       "  '86': 2,\n",
       "  '96': 2,\n",
       "  'all eight': 1,\n",
       "  '90': 2,\n",
       "  '84': 1,\n",
       "  '81': 1,\n",
       "  'more than 20': 1,\n",
       "  'more than 7': 1,\n",
       "  '101': 1,\n",
       "  'fewer than two dozen': 1,\n",
       "  '430': 1,\n",
       "  '10 or 15': 1,\n",
       "  '552': 1,\n",
       "  'just under 176': 1,\n",
       "  'between 152 and 157': 1,\n",
       "  'Two': 7,\n",
       "  '289': 1,\n",
       "  '450': 1,\n",
       "  '458': 1,\n",
       "  'at least one': 4,\n",
       "  'about half': 5,\n",
       "  '50': 3,\n",
       "  'just 550': 1,\n",
       "  '400': 2,\n",
       "  '460': 1,\n",
       "  '485': 1,\n",
       "  '68': 4,\n",
       "  '8': 4,\n",
       "  '9': 5,\n",
       "  '10': 14,\n",
       "  'zero': 3,\n",
       "  '265': 1,\n",
       "  '235': 1,\n",
       "  '275': 1,\n",
       "  '295': 1,\n",
       "  '3': 11,\n",
       "  '5': 13,\n",
       "  'about one to': 1,\n",
       "  'only about 10 to 20': 1,\n",
       "  'an additional 200': 1,\n",
       "  '13 million': 1,\n",
       "  '125': 1,\n",
       "  'hundreds of thousands': 2,\n",
       "  '#': 2,\n",
       "  'six': 8,\n",
       "  '33': 5,\n",
       "  'more than half': 3,\n",
       "  '214': 1,\n",
       "  '338': 1,\n",
       "  '15': 4,\n",
       "  'a quarter': 1,\n",
       "  '266': 1,\n",
       "  'at least three': 3,\n",
       "  '4x4': 1,\n",
       "  '36x54': 1,\n",
       "  '99': 2,\n",
       "  '8x12': 1,\n",
       "  'about 1': 2,\n",
       "  '800': 3,\n",
       "  '600': 2,\n",
       "  '95': 1,\n",
       "  '37': 2,\n",
       "  '12': 6,\n",
       "  '6': 6,\n",
       "  'more than eight': 2,\n",
       "  'half million': 1,\n",
       "  '4 billion': 2,\n",
       "  '472': 1,\n",
       "  'Around 3': 1,\n",
       "  'only one': 2,\n",
       "  'Five': 24,\n",
       "  'more than 250': 1,\n",
       "  '670': 1,\n",
       "  'hundreds of millions': 1,\n",
       "  'at least 36': 1,\n",
       "  'six million': 1,\n",
       "  'at least 20': 1,\n",
       "  'at least 70': 1,\n",
       "  '21': 3,\n",
       "  'ten': 1,\n",
       "  '43': 1,\n",
       "  '4': 4,\n",
       "  '4:40': 1,\n",
       "  '44': 1,\n",
       "  '4:35': 1,\n",
       "  '47': 1,\n",
       "  '34': 1,\n",
       "  'more than one million': 1,\n",
       "  '40': 3,\n",
       "  'some 3': 1,\n",
       "  '’90': 1,\n",
       "  '76': 1,\n",
       "  '11': 3,\n",
       "  '48': 3,\n",
       "  'only 51': 2,\n",
       "  '60': 1,\n",
       "  'at least 39': 3,\n",
       "  'no fewer than 12': 1,\n",
       "  'about 60': 2,\n",
       "  '85': 1,\n",
       "  '2 million': 3,\n",
       "  'Eight': 1,\n",
       "  'at least 22': 1,\n",
       "  '39': 1,\n",
       "  'At least two dozen': 1,\n",
       "  'more than 2': 1,\n",
       "  'at least two': 2,\n",
       "  'roughly 10': 1,\n",
       "  'More than 100': 1,\n",
       "  'nearly 70': 1,\n",
       "  'as many as 40': 1,\n",
       "  '30': 4,\n",
       "  '100': 10,\n",
       "  'fewer than 10': 1,\n",
       "  'more than 100': 5,\n",
       "  'more than 50': 1,\n",
       "  'At least two': 1,\n",
       "  '7': 2,\n",
       "  '737': 1,\n",
       "  'more than 80': 1,\n",
       "  'at least 56': 1,\n",
       "  'more than 1': 3,\n",
       "  '200': 3,\n",
       "  'about 2': 2,\n",
       "  '1 million': 1,\n",
       "  '111': 1,\n",
       "  '73': 2,\n",
       "  'less than a tenth': 1,\n",
       "  '70': 2,\n",
       "  'as many as 1': 1,\n",
       "  'more than 200': 1,\n",
       "  '45': 1,\n",
       "  '025': 1,\n",
       "  '360': 4,\n",
       "  '500': 4,\n",
       "  'seven': 4,\n",
       "  'some 20 million': 1,\n",
       "  '0': 8,\n",
       "  '20 million': 3,\n",
       "  'more than four million': 1,\n",
       "  'just one': 1,\n",
       "  '49': 4,\n",
       "  'Hundreds': 2,\n",
       "  'more than two and a half hours': 1,\n",
       "  'about four million': 1,\n",
       "  'more than nine million': 1,\n",
       "  'more than 14 million': 1,\n",
       "  '54': 2,\n",
       "  'fewer than 50': 2,\n",
       "  '50 million': 1,\n",
       "  '30 million': 2,\n",
       "  '700': 2,\n",
       "  '24': 3,\n",
       "  '412': 1,\n",
       "  '560': 1,\n",
       "  '129': 1,\n",
       "  '998': 1,\n",
       "  '138': 1,\n",
       "  '335': 1,\n",
       "  '352': 1,\n",
       "  '762': 1,\n",
       "  '29': 1,\n",
       "  '42': 1,\n",
       "  '57': 1,\n",
       "  'About a third': 1,\n",
       "  'Just under a third': 1,\n",
       "  '2008': 1,\n",
       "  'Hundreds of thousands': 1,\n",
       "  '110': 1,\n",
       "  '195': 1,\n",
       "  '23': 1,\n",
       "  '20': 2,\n",
       "  '51': 1,\n",
       "  'about 20 million': 1,\n",
       "  'Twenty': 1,\n",
       "  '26': 3,\n",
       "  '5 million': 5,\n",
       "  '2 billion': 2,\n",
       "  'two or four or five': 1,\n",
       "  'Eighteen': 1,\n",
       "  'more than 30': 1,\n",
       "  '13': 1,\n",
       "  '74': 1,\n",
       "  'Tens of thousands': 1,\n",
       "  '79 million': 1,\n",
       "  '22 million': 1,\n",
       "  '120': 1,\n",
       "  'four million': 1,\n",
       "  'roughly 400': 1,\n",
       "  '5850': 1,\n",
       "  '748': 1,\n",
       "  'a thousand': 1,\n",
       "  '’d': 1,\n",
       "  '32': 1,\n",
       "  '5 billion': 2,\n",
       "  '250': 1,\n",
       "  '162': 1,\n",
       "  '792': 1,\n",
       "  'roughly 120': 1,\n",
       "  'hundredth': 1,\n",
       "  'nearly one million': 1,\n",
       "  '451': 1,\n",
       "  '420': 1,\n",
       "  '64': 1,\n",
       "  'Nineteen': 1,\n",
       "  'nearly half a million': 1,\n",
       "  'at least 47': 1,\n",
       "  '415': 1,\n",
       "  'nearly six million': 1,\n",
       "  'at least seven': 1,\n",
       "  'At least 25': 1,\n",
       "  'two or three': 1,\n",
       "  'more than a fifth': 1,\n",
       "  'just 4': 1,\n",
       "  'more than 150': 1,\n",
       "  '158': 1,\n",
       "  'At least a dozen': 1,\n",
       "  '140': 1,\n",
       "  'Millions': 1,\n",
       "  'About 24': 1,\n",
       "  'at least 80': 1,\n",
       "  'roughly 7': 1,\n",
       "  '93 million': 1,\n",
       "  '8 million': 2,\n",
       "  '31': 1,\n",
       "  '7 million': 1,\n",
       "  '359': 1,\n",
       "  '495': 1,\n",
       "  '3 million': 2,\n",
       "  'an estimated 60': 1,\n",
       "  '9 million': 3,\n",
       "  'Thirteen': 1,\n",
       "  'some eight million': 1,\n",
       "  '189': 1,\n",
       "  '121': 1,\n",
       "  'At least one': 1,\n",
       "  'zeros': 1,\n",
       "  'dozen': 1,\n",
       "  'half a dozen': 1,\n",
       "  '053': 1,\n",
       "  '761': 1,\n",
       "  '800 to 3': 1,\n",
       "  'more than 60': 1,\n",
       "  'just as thousands': 1,\n",
       "  'nearly 300': 1,\n",
       "  'more than 10': 2,\n",
       "  '1 billion': 1,\n",
       "  'several dozens': 1,\n",
       "  'over 100': 1,\n",
       "  '55 million': 2,\n",
       "  '47 million': 1,\n",
       "  'below 11 million': 1,\n",
       "  '69 million': 1,\n",
       "  '17 million': 1,\n",
       "  '319': 1,\n",
       "  '04 million': 1,\n",
       "  '237': 1,\n",
       "  '61 million': 1,\n",
       "  '820': 1,\n",
       "  '192': 1,\n",
       "  '24 million': 1,\n",
       "  '579': 1,\n",
       "  'more than 54': 1,\n",
       "  'about 4': 1,\n",
       "  '730': 1,\n",
       "  'about 30': 1,\n",
       "  'an additional 6': 1},\n",
       " 'DATE': {'years': 30,\n",
       "  'at least late February': 1,\n",
       "  '2015': 36,\n",
       "  'last month': 13,\n",
       "  'Jan. 20, 2017': 1,\n",
       "  'this month': 4,\n",
       "  '2010': 15,\n",
       "  'September': 12,\n",
       "  'this year': 29,\n",
       "  'this summer': 5,\n",
       "  'four years': 3,\n",
       "  'an era': 1,\n",
       "  '40': 1,\n",
       "  '1991': 1,\n",
       "  'three years ago': 1,\n",
       "  '11': 2,\n",
       "  'August 2015': 3,\n",
       "  'the same day': 2,\n",
       "  'Three days later': 1,\n",
       "  '10 days': 3,\n",
       "  'A week later': 2,\n",
       "  'some months later': 1,\n",
       "  'one day': 4,\n",
       "  'early September': 1,\n",
       "  '2012': 11,\n",
       "  'that year': 2,\n",
       "  '15': 2,\n",
       "  'today': 19,\n",
       "  'last year': 32,\n",
       "  'five years': 2,\n",
       "  '15 years ago': 1,\n",
       "  'Last year': 5,\n",
       "  'last January': 4,\n",
       "  'four days': 2,\n",
       "  '32': 1,\n",
       "  '37': 3,\n",
       "  '2001': 5,\n",
       "  'the same period': 2,\n",
       "  'those years': 1,\n",
       "  'the late 1980s': 1,\n",
       "  'last year’s': 1,\n",
       "  'the last five years': 1,\n",
       "  'November': 18,\n",
       "  'the months': 2,\n",
       "  'October': 10,\n",
       "  'Oct. 20, 2015': 1,\n",
       "  'months': 17,\n",
       "  'two weeks later': 1,\n",
       "  'May': 5,\n",
       "  '1942': 2,\n",
       "  'the Song dynasty': 2,\n",
       "  'decades': 14,\n",
       "  'the years': 14,\n",
       "  'his 90s': 1,\n",
       "  'Friday': 12,\n",
       "  'later years': 2,\n",
       "  'the 20th century': 3,\n",
       "  '1932': 1,\n",
       "  '1934': 1,\n",
       "  'the 1930s to the 1960s': 1,\n",
       "  '1949': 1,\n",
       "  '1955': 4,\n",
       "  '1969': 2,\n",
       "  'March': 7,\n",
       "  '2013': 8,\n",
       "  '2014': 21,\n",
       "  'more than nine decades earlier': 1,\n",
       "  'Oct. 25, 1910': 1,\n",
       "  '1920': 1,\n",
       "  '1882': 1,\n",
       "  '1906': 1,\n",
       "  'Dec. 30, 1920': 1,\n",
       "  'a month': 3,\n",
       "  '1995': 4,\n",
       "  '2016': 32,\n",
       "  'nearly a month': 1,\n",
       "  'Jan. 27, 1921': 1,\n",
       "  'Two years later': 1,\n",
       "  'summer': 8,\n",
       "  'at least five years': 1,\n",
       "  'the 1930s': 1,\n",
       "  '1936 to 1938': 1,\n",
       "  '1938': 1,\n",
       "  'the late 1930s': 1,\n",
       "  '1923': 1,\n",
       "  '1937': 1,\n",
       "  '1996': 2,\n",
       "  'two years': 5,\n",
       "  '1941': 1,\n",
       "  '1968': 2,\n",
       "  'December 1941': 1,\n",
       "  '1946': 1,\n",
       "  'Christmas': 3,\n",
       "  'the last 15 years': 2,\n",
       "  '2003': 9,\n",
       "  'the bleakest year': 1,\n",
       "  'The year': 2,\n",
       "  '69': 1,\n",
       "  'just two days': 1,\n",
       "  'about three months later': 1,\n",
       "  '57': 1,\n",
       "  'his sixth decade': 1,\n",
       "  'his 83rd year': 1,\n",
       "  'the year': 11,\n",
       "  'the 1980s': 4,\n",
       "  '53': 3,\n",
       "  'all year': 3,\n",
       "  'the early days': 1,\n",
       "  '88': 1,\n",
       "  '1951': 1,\n",
       "  '64': 1,\n",
       "  '74': 1,\n",
       "  'the 1940s': 1,\n",
       "  'the 1960s': 2,\n",
       "  'Just a day later': 1,\n",
       "  'earlier era': 1,\n",
       "  'the same year': 1,\n",
       "  'so years ago': 1,\n",
       "  'two ago': 1,\n",
       "  'their day': 2,\n",
       "  'the last half of the 20th century': 1,\n",
       "  'the ’80s': 3,\n",
       "  'the early 1940s': 1,\n",
       "  'a few weeks ago': 1,\n",
       "  'Sunday': 32,\n",
       "  'less than a month': 1,\n",
       "  'the last decade': 2,\n",
       "  'annual': 10,\n",
       "  'coming months': 2,\n",
       "  'Jan. 20': 7,\n",
       "  'Dec. 9': 1,\n",
       "  'recent years': 10,\n",
       "  'February': 4,\n",
       "  'April': 8,\n",
       "  'Sept. 9': 1,\n",
       "  'more than a week': 1,\n",
       "  'A week earlier': 1,\n",
       "  'Christmas Day': 1,\n",
       "  '1988': 2,\n",
       "  '1952': 2,\n",
       "  'Saturday': 7,\n",
       "  'December': 16,\n",
       "  'recent weeks': 2,\n",
       "  'Monday': 23,\n",
       "  'the coming months': 2,\n",
       "  'January': 7,\n",
       "  'Thursday': 32,\n",
       "  'Season 8': 1,\n",
       "  'seven months': 3,\n",
       "  'Dec. 8, 2009': 1,\n",
       "  'season’s': 3,\n",
       "  'Season 8’s': 1,\n",
       "  'six years': 4,\n",
       "  'as long as six years': 1,\n",
       "  'six years later': 2,\n",
       "  'Six years': 1,\n",
       "  'Season 8 ended': 1,\n",
       "  'last fall': 1,\n",
       "  'three days': 6,\n",
       "  'last week': 13,\n",
       "  '36': 2,\n",
       "  'eight or nine weeks': 1,\n",
       "  'the next year': 2,\n",
       "  '46': 4,\n",
       "  'four months': 1,\n",
       "  'two and a half hours': 1,\n",
       "  'the day of the   ': 1,\n",
       "  'two weeks': 1,\n",
       "  'the next four years': 4,\n",
       "  'two years ago': 2,\n",
       "  'more than a few months': 1,\n",
       "  'five years ago': 1,\n",
       "  '38': 1,\n",
       "  '2011': 11,\n",
       "  '4100': 1,\n",
       "  'almost a year': 1,\n",
       "  '2000': 2,\n",
       "  'later that year': 1,\n",
       "  '2005': 4,\n",
       "  'monthly': 3,\n",
       "  'nine months': 2,\n",
       "  'A few months later': 1,\n",
       "  'early 2014': 1,\n",
       "  'Jan. 1, 2016': 1,\n",
       "  'Dec. 10': 1,\n",
       "  '1936': 1,\n",
       "  'Dec. 10, 2016': 1,\n",
       "  '14': 1,\n",
       "  '29': 1,\n",
       "  '1983': 1,\n",
       "  '1987': 1,\n",
       "  '50': 2,\n",
       "  '2007': 7,\n",
       "  '24': 3,\n",
       "  'the summer': 4,\n",
       "  '22': 3,\n",
       "  'August': 9,\n",
       "  'the middle of December': 1,\n",
       "  'the next decade': 1,\n",
       "  'a decade': 2,\n",
       "  'a year ago': 3,\n",
       "  'the next few years': 2,\n",
       "  'Later this month': 1,\n",
       "  'the hottest year': 1,\n",
       "  'each year': 6,\n",
       "  'the new year this weekend': 1,\n",
       "  'the past two weeks': 1,\n",
       "  'winter': 3,\n",
       "  '1973': 3,\n",
       "  'Thanksgiving': 1,\n",
       "  'years ago': 1,\n",
       "  'nearly 25 years': 1,\n",
       "  'each day': 2,\n",
       "  'our 20s': 1,\n",
       "  '20s': 1,\n",
       "  '2002': 3,\n",
       "  '1980s': 1,\n",
       "  'weeks': 7,\n",
       "  'more than two months': 1,\n",
       "  'nearly a century': 1,\n",
       "  'the first day of 2017': 1,\n",
       "  '70': 3,\n",
       "  '4': 1,\n",
       "  '1948': 1,\n",
       "  'the 1920s': 2,\n",
       "  'nearly a decade': 3,\n",
       "  'the 1970s': 5,\n",
       "  '2016 many years ago': 1,\n",
       "  'December 2016': 1,\n",
       "  '62': 1,\n",
       "  '91': 1,\n",
       "  'another day': 1,\n",
       "  '10 years': 3,\n",
       "  '77': 1,\n",
       "  'June 2015': 3,\n",
       "  'Tuesday': 42,\n",
       "  'Dec. 16': 1,\n",
       "  'Wednesday': 50,\n",
       "  '10 days earlier': 1,\n",
       "  'two days': 1,\n",
       "  '2009': 14,\n",
       "  '2008': 12,\n",
       "  'the 41 years': 1,\n",
       "  'midnight Friday': 1,\n",
       "  'the last day': 2,\n",
       "  '39': 1,\n",
       "  'nearly two months': 1,\n",
       "  'Nov. 8': 1,\n",
       "  'the centenary year': 1,\n",
       "  'daily': 9,\n",
       "  'his first two years': 1,\n",
       "  'Seven weeks': 1,\n",
       "  '42': 1,\n",
       "  '65': 2,\n",
       "  'the days': 2,\n",
       "  'the past year': 2,\n",
       "  '28': 1,\n",
       "  'Late last month': 1,\n",
       "  'a favorite summer': 1,\n",
       "  'the day': 14,\n",
       "  'between 24 and 48 hours': 1,\n",
       "  'Week 11': 1,\n",
       "  'the week': 3,\n",
       "  'the season': 2,\n",
       "  '49ers': 1,\n",
       "  'Week 17’s': 1,\n",
       "  'Week 16': 1,\n",
       "  'Week 17': 1,\n",
       "  'Week 14': 1,\n",
       "  'Just a week': 1,\n",
       "  'next week': 6,\n",
       "  'bye weeks': 1,\n",
       "  'the 1990s': 6,\n",
       "  '2017': 22,\n",
       "  'Jan. 9': 2,\n",
       "  'several weeks ago': 1,\n",
       "  'the last year': 3,\n",
       "  '000 years': 1,\n",
       "  'more than 20 years': 1,\n",
       "  'the first half of the 20th century': 1,\n",
       "  'This past month': 1,\n",
       "  'that era': 1,\n",
       "  'several days': 3,\n",
       "  '1990': 1,\n",
       "  'six and a half minutes': 1,\n",
       "  '53 last Sunday': 1,\n",
       "  'this week': 14,\n",
       "  'a day': 5,\n",
       "  'the end of the day': 4,\n",
       "  'those days': 2,\n",
       "  'the ’40s': 1,\n",
       "  'fall or': 1,\n",
       "  'early winter': 1,\n",
       "  'tomorrow': 3,\n",
       "  'three years': 4,\n",
       "  'the ’90s': 2,\n",
       "  '10 years old': 1,\n",
       "  '20 years': 2,\n",
       "  'the first 100 days': 1,\n",
       "  'late December': 1,\n",
       "  '60 legislative days': 1,\n",
       "  'the fiscal year': 1,\n",
       "  'a tumultuous decade': 1,\n",
       "  '2006': 4,\n",
       "  'Eight years': 1,\n",
       "  'four decades': 1,\n",
       "  'weekly': 1,\n",
       "  'the weekend': 3,\n",
       "  'as early as Sunday': 1,\n",
       "  '1944': 1,\n",
       "  '125 years ago today': 1,\n",
       "  '43 years ago this week': 1,\n",
       "  '1974': 3,\n",
       "  '1901': 1,\n",
       "  'weekday': 1,\n",
       "  'January 2004': 1,\n",
       "  'late November': 1,\n",
       "  'August 2010 to March 2013': 1,\n",
       "  'days earlier': 1,\n",
       "  'June 6, 2003': 1,\n",
       "  'just days': 1,\n",
       "  'Dec. 22': 4,\n",
       "  'the spring and summer of 2015': 1,\n",
       "  'early August of that year': 1,\n",
       "  '14 years': 3,\n",
       "  'A few weeks later': 1,\n",
       "  'October 2002': 1,\n",
       "  'Sept. 11': 2,\n",
       "  'that day': 4,\n",
       "  'July 2008': 1,\n",
       "  'the end of 2008': 1,\n",
       "  'January 2009': 1,\n",
       "  'the fall of 2009': 1,\n",
       "  'July 2011': 2,\n",
       "  'late 2009': 1,\n",
       "  'A few months': 1,\n",
       "  'the spring of 2010': 1,\n",
       "  'August 2010': 1,\n",
       "  'May 2011': 1,\n",
       "  'May 1, 2012': 1,\n",
       "  'One year ago': 1,\n",
       "  'the end of 2016': 1,\n",
       "  '10 years from now': 1,\n",
       "  'July': 2,\n",
       "  'a year': 2,\n",
       "  'half the year': 1,\n",
       "  'late Monday': 1,\n",
       "  'late September': 1,\n",
       "  'late last month': 2,\n",
       "  'late 2019': 1,\n",
       "  'some quarters': 1,\n",
       "  'days': 5,\n",
       "  'nine years ago': 1,\n",
       "  '2019': 2,\n",
       "  'recent decades': 3,\n",
       "  '1992': 1,\n",
       "  'Sept. 1': 1,\n",
       "  'two days later': 1,\n",
       "  '2018': 3,\n",
       "  'December 2015': 1,\n",
       "  'A month ago': 1,\n",
       "  'less than a week later': 1,\n",
       "  'early January': 1,\n",
       "  'the late 1970s': 2,\n",
       "  'the spring season': 1,\n",
       "  'Saturdays': 1,\n",
       "  'season': 2,\n",
       "  'late October through March': 1,\n",
       "  'the next day': 1,\n",
       "  '1979': 4,\n",
       "  '52': 1,\n",
       "  '1999': 4,\n",
       "  '1970s': 2,\n",
       "  'more recent years': 1,\n",
       "  'between ages 18 and 23': 1,\n",
       "  'about 15 years': 1,\n",
       "  '1994': 1,\n",
       "  '1978': 2,\n",
       "  '49': 1,\n",
       "  'October 2015': 1,\n",
       "  'The day': 2,\n",
       "  'Minutes later': 1,\n",
       "  '90 days': 1,\n",
       "  'first day': 1,\n",
       "  'Hours later': 1,\n",
       "  'last weekend': 1,\n",
       "  'more than a year ago': 1,\n",
       "  '30 years': 1,\n",
       "  'the new year': 1,\n",
       "  'This month': 1,\n",
       "  '1825': 1,\n",
       "  '1829': 1,\n",
       "  '1775': 1,\n",
       "  '1795': 1,\n",
       "  '1797': 1,\n",
       "  '1801': 1,\n",
       "  '1852': 1,\n",
       "  'the spring': 3,\n",
       "  'Jan. 27': 3,\n",
       "  'last June': 2,\n",
       "  'several years': 2,\n",
       "  'the last few decades': 1,\n",
       "  'nearly 20 years': 1,\n",
       "  'several decades': 2,\n",
       "  '25 years': 2,\n",
       "  'July 27': 1,\n",
       "  'next Wednesday': 1,\n",
       "  'the coming years': 1,\n",
       "  'more than 60 years ago': 1,\n",
       "  'up to 32 months': 1,\n",
       "  '21': 3,\n",
       "  'Jan. 15': 5,\n",
       "  'Fifty years': 1,\n",
       "  'all day': 2,\n",
       "  'workday': 1,\n",
       "  'the next five and a half hours': 1,\n",
       "  'the start of the day': 1,\n",
       "  'the other days': 1,\n",
       "  '21st Century Fox': 2,\n",
       "  '12 years': 2,\n",
       "  'many years': 2,\n",
       "  'the weeks': 2,\n",
       "  'Election Day': 7,\n",
       "  'the final year': 1,\n",
       "  'Monday through Friday': 1,\n",
       "  'last May': 1,\n",
       "  'the end of that': 1,\n",
       "  'the last 10 years': 1,\n",
       "  'year': 7,\n",
       "  'her past few months': 1,\n",
       "  'just one year': 1,\n",
       "  'two seasons': 1,\n",
       "  'five weeks': 1,\n",
       "  'This season': 1,\n",
       "  'nearly every day': 1,\n",
       "  'the last two weeks': 1,\n",
       "  'the last two years': 2,\n",
       "  'past decades': 1,\n",
       "  '16': 1,\n",
       "  '2025': 1,\n",
       "  'the end of 2020': 1,\n",
       "  'under 11': 1,\n",
       "  'seven or eight years': 1,\n",
       "  'weekends': 3,\n",
       "  '1990s': 1,\n",
       "  'the last 40 years': 1,\n",
       "  'the last half decade': 1,\n",
       "  'Nearly a year ago': 1,\n",
       "  'the last few years': 3,\n",
       "  'the year before': 3,\n",
       "  'Dec. 28 of each year': 1,\n",
       "  'year’s end': 1,\n",
       "  'at least the early 1990s': 1,\n",
       "  '50 the year before': 1,\n",
       "  'Dec. 28': 1,\n",
       "  'three the year before': 1,\n",
       "  'about half a century ago': 1,\n",
       "  '2004': 3,\n",
       "  'the late 19th century': 1,\n",
       "  'the middle of the 20th century': 1,\n",
       "  'Eight years later': 1,\n",
       "  '1956': 2,\n",
       "  '1964': 1,\n",
       "  'every year': 1,\n",
       "  'this past year': 1,\n",
       "  'November 2015': 1,\n",
       "  'Oct. 8': 1,\n",
       "  'fall 2011': 1,\n",
       "  'June': 5,\n",
       "  'three months later': 1,\n",
       "  'July 3': 1,\n",
       "  'six months later': 1,\n",
       "  'Nov. 26': 1,\n",
       "  'May 2014': 2,\n",
       "  'August 2014': 1,\n",
       "  'Sept. 4': 1,\n",
       "  'May 7': 1,\n",
       "  'early 2011': 1,\n",
       "  'July 2015': 3,\n",
       "  'their first day': 1,\n",
       "  'Aug. 6': 1,\n",
       "  'March 11, 2005': 1,\n",
       "  'March 11, 2015': 1,\n",
       "  '10 years to the day': 1,\n",
       "  'March 11': 2,\n",
       "  'a full day': 1,\n",
       "  'September 2013': 1,\n",
       "  'Nov. 13': 1,\n",
       "  'June 2014': 1,\n",
       "  'January 2015': 1,\n",
       "  'a weekend': 2,\n",
       "  'June 11': 1,\n",
       "  'The past few years': 1,\n",
       "  'several months': 3,\n",
       "  'the past 35 years': 1,\n",
       "  '1980': 3,\n",
       "  '1981': 2,\n",
       "  'six decades': 1,\n",
       "  '1997': 1,\n",
       "  'the same day in 1997': 1,\n",
       "  'January 2016': 1,\n",
       "  'the very first day': 1,\n",
       "  'Day 1': 1,\n",
       "  'later this year': 1,\n",
       "  '1971': 1,\n",
       "  'more than a century': 2,\n",
       "  'a decade ago': 2,\n",
       "  'the six weeks': 2,\n",
       "  'Dec. 15': 1,\n",
       "  'six days': 1,\n",
       "  'the second row': 1,\n",
       "  '15 years': 4,\n",
       "  '45': 1,\n",
       "  '59': 1,\n",
       "  'hours later': 1,\n",
       "  'last summer': 4,\n",
       "  'three months': 2,\n",
       "  'Today': 4,\n",
       "  'nearly two weeks': 2,\n",
       "  '5': 1,\n",
       "  'Jan. 23': 1,\n",
       "  'every day': 2,\n",
       "  'One year': 1,\n",
       "  '25': 1,\n",
       "  'a few days': 1,\n",
       "  '1849': 1,\n",
       "  '1851': 1,\n",
       "  'a year later': 1,\n",
       "  'Fourteen years later': 1,\n",
       "  'the 19th century': 3,\n",
       "  'Five years ago': 1,\n",
       "  'its final weekend': 1,\n",
       "  'a week': 2,\n",
       "  'the next few weeks': 1,\n",
       "  'more than three days': 1,\n",
       "  'A few years ago': 1,\n",
       "  'd’y': 1,\n",
       "  '19e': 1,\n",
       "  'the 12th straight year': 1,\n",
       "  'many wet days': 1,\n",
       "  'this the year': 1,\n",
       "  'June 28 to July 9': 1,\n",
       "  'June 16 to 18': 1,\n",
       "  '50 this year': 1,\n",
       "  'the same weekend': 1,\n",
       "  '1967': 1,\n",
       "  'November and December': 1,\n",
       "  'Jan. 18 to Feb. 1': 1,\n",
       "  'past years': 1,\n",
       "  'May 25': 1,\n",
       "  'July 21 to Aug. 30': 1,\n",
       "  'March 19 to 23': 1,\n",
       "  'Midyear': 1,\n",
       "  'two nights': 1,\n",
       "  'last March': 1,\n",
       "  'This spring': 1,\n",
       "  'seven to 13 nights': 1,\n",
       "  '27 days': 1,\n",
       "  'Aug. 31': 1,\n",
       "  'the end of the year': 2,\n",
       "  'a week or': 1,\n",
       "  'a few more days': 1,\n",
       "  'last season’s': 1,\n",
       "  'Jan. 19': 1,\n",
       "  'the past decade': 1,\n",
       "  'the late 20th century': 1,\n",
       "  'a dozen years ago': 1,\n",
       "  'Jan. 29': 2,\n",
       "  'Jan. 11': 1,\n",
       "  'the recent years': 1,\n",
       "  'May 18, 2014': 1,\n",
       "  'This past September': 1,\n",
       "  'another year': 1,\n",
       "  'each passing year': 1,\n",
       "  'Nearly two years later': 1,\n",
       "  'an earlier era': 1,\n",
       "  'Between 2012 and 2014': 2,\n",
       "  'A couple of months later': 1,\n",
       "  '48': 3,\n",
       "  'his senior year': 1,\n",
       "  'these early days': 1,\n",
       "  'More than a year later': 1,\n",
       "  'this fall': 2,\n",
       "  'the spring of 2013': 1,\n",
       "  'May of that year': 1,\n",
       "  'about a year ago': 1,\n",
       "  'May 2015': 1,\n",
       "  'One month later': 1,\n",
       "  'one year later': 1,\n",
       "  '2014 to 2024': 1,\n",
       "  '31': 1,\n",
       "  'recent months': 3,\n",
       "  'Dec. 23': 3,\n",
       "  'June 2016': 1,\n",
       "  'Dec. 29': 1,\n",
       "  'Later that day': 2,\n",
       "  'just six months': 1,\n",
       "  'the next several years': 2,\n",
       "  'about six months ago': 1,\n",
       "  '43': 2,\n",
       "  '1913': 1,\n",
       "  'his years': 1,\n",
       "  '10 or 15 years ago': 1,\n",
       "  'early Wednesday': 1,\n",
       "  'last August': 1,\n",
       "  'Eight years ago': 1,\n",
       "  'Earlier that day': 1,\n",
       "  '18 years': 1,\n",
       "  'the most recent quarter': 1,\n",
       "  'the same period a year earlier': 3,\n",
       "  'between July 2011': 1,\n",
       "  'March 2014': 1,\n",
       "  'more than 104 years ago': 1,\n",
       "  'as long as three weeks': 1,\n",
       "  'more than 30 years': 1,\n",
       "  'January 21': 1,\n",
       "  'About four years ago': 1,\n",
       "  '1912': 1,\n",
       "  'April 15, 1912': 1,\n",
       "  'the 1950s': 1,\n",
       "  'April 14, 1912': 1,\n",
       "  'the first three months': 1,\n",
       "  'Jan. 12': 1,\n",
       "  'March 12': 1,\n",
       "  'a few years': 1,\n",
       "  'the   week': 2,\n",
       "  'more than a century ago': 1,\n",
       "  '1903': 1,\n",
       "  'the week ending Jan. 1': 1,\n",
       "  'the previous week': 1,\n",
       "  'the same week': 1,\n",
       "  'the previous year': 3,\n",
       "  'the holiday': 1,\n",
       "  'a banner year': 1,\n",
       "  '58': 1,\n",
       "  'between Christmas': 1,\n",
       "  'this winter': 1,\n",
       "  'last week 25': 1,\n",
       "  'the current season': 1,\n",
       "  '1812': 1,\n",
       "  'the last week': 1,\n",
       "  'its best week': 1,\n",
       "  'between Dec. 31': 1,\n",
       "  'late winter': 1,\n",
       "  'four years earlier': 1,\n",
       "  '19 years': 1,\n",
       "  'the coming year': 2,\n",
       "  'three decades ago': 1,\n",
       "  'the era': 1,\n",
       "  'One Day': 1,\n",
       "  '1975': 1,\n",
       "  'just five years': 1,\n",
       "  'the ’70s': 1,\n",
       "  'more than 100 years': 1,\n",
       "  'Dec. 17, 1892': 1,\n",
       "  'May 2, 2016': 1,\n",
       "  '76': 1,\n",
       "  '1957': 1,\n",
       "  'early Thursday': 1,\n",
       "  'Early next week': 1,\n",
       "  'later this month': 1,\n",
       "  '1961': 1,\n",
       "  'Sept. 11, 2001': 2,\n",
       "  'Six years later': 1,\n",
       "  '73': 1,\n",
       "  '1998': 1,\n",
       "  'only three days': 1,\n",
       "  'a day earlier': 1,\n",
       "  'January 2011': 1,\n",
       "  'September 2015': 1,\n",
       "  'the next several weeks': 1,\n",
       "  '44 years ago': 1,\n",
       "  'nearly seven months': 1,\n",
       "  'months later': 2,\n",
       "  'online day': 1,\n",
       "  'recent days': 1,\n",
       "  'June 19, 1972': 1,\n",
       "  'a couple of months': 1,\n",
       "  'March 22': 1,\n",
       "  'March 19': 1,\n",
       "  'the middle of April': 1,\n",
       "  'two decades': 1,\n",
       "  'Oct. 7, 1996': 1,\n",
       "  'two decades later': 1,\n",
       "  'The next year': 1,\n",
       "  'February 2014': 1,\n",
       "  'Around Christmas': 1,\n",
       "  'April 29': 1,\n",
       "  'the summer of 2015': 1,\n",
       "  'March 2016': 1,\n",
       "  'next day': 1,\n",
       "  'a period of weeks': 1,\n",
       "  'Weeks later': 1,\n",
       "  'July 6, 12 days': 1,\n",
       "  'July 22': 1,\n",
       "  '44': 1,\n",
       "  'July 25': 1,\n",
       "  'Oct. 7': 2,\n",
       "  'The same day': 1,\n",
       "  'WikiLeaks day after day': 1,\n",
       "  'the last month': 1,\n",
       "  'Days': 1,\n",
       "  'late 2014': 1,\n",
       "  'late August': 1,\n",
       "  'early October': 1,\n",
       "  'more than 30 days': 1,\n",
       "  'Two weeks ago': 1,\n",
       "  'next year': 1,\n",
       "  'early 1980s': 1,\n",
       "  '1964 to 1982': 1,\n",
       "  'March 2010': 1,\n",
       "  'just a few weeks': 1,\n",
       "  'two to four years': 1,\n",
       "  'five months': 1,\n",
       "  'the school year': 1,\n",
       "  'midyear': 1,\n",
       "  'just months': 1,\n",
       "  'another couple of weeks': 1,\n",
       "  'couple of months': 1,\n",
       "  'later Thursday': 1,\n",
       "  '150 years ago': 1,\n",
       "  'Dec. 30': 1,\n",
       "  '18': 1,\n",
       "  '20': 1,\n",
       "  '1986': 1,\n",
       "  'only about five years old': 1,\n",
       "  '26': 1,\n",
       "  'the Dec. 5 Christmas parade': 1,\n",
       "  '41': 1,\n",
       "  'more than five years': 1,\n",
       "  'the waning days': 1,\n",
       "  'Just last year': 1,\n",
       "  '’s final days': 1,\n",
       "  'several years ago': 1,\n",
       "  'more than 10 days': 1,\n",
       "  'Halloween': 1,\n",
       "  'the previous three years': 1,\n",
       "  'those final days': 1,\n",
       "  'nearly a century ago': 1,\n",
       "  'Last September': 1,\n",
       "  '2016 fiscal year': 2,\n",
       "  'Oct. 29': 1,\n",
       "  'Last spring': 1,\n",
       "  'late fall': 1,\n",
       "  'the end of the third year': 1,\n",
       "  'Nearly two years ago': 1,\n",
       "  'an uncertain year': 1,\n",
       "  'these days': 1,\n",
       "  'the fourth quarter of 2016': 1,\n",
       "  'the month of December': 1,\n",
       "  'the same month': 1,\n",
       "  'a year earlier': 1,\n",
       "  'the full year': 2,\n",
       "  'the month': 1,\n",
       "  'its first month': 1,\n",
       "  'the middle of 2016': 1,\n",
       "  '63': 1,\n",
       "  'the middle of 2017': 1},\n",
       " 'LAW': {'Constitution': 3,\n",
       "  'Precinct’s': 1,\n",
       "  'the Chinese Exclusion Act': 1,\n",
       "  'The Paris Agreement': 1,\n",
       "  'the Clean Air Task Force': 1,\n",
       "  'Louvre’s': 1,\n",
       "  'the Affordable Care Act': 12,\n",
       "  'Falcon 9': 1,\n",
       "  'the Fabulous Five': 1,\n",
       "  'the Betrayal of Democracy': 1,\n",
       "  'Obamas': 1,\n",
       "  'the Foreign Corrupt Practices Act': 1,\n",
       "  'the Grateful Dead': 1,\n",
       "  'Terminals 2 and 4': 1,\n",
       "  'the D. E. A.': 1,\n",
       "  'the Voting Rights Act': 1},\n",
       " 'LOC': {'The South Bronx': 1,\n",
       "  'the Harlem River': 1,\n",
       "  'the South Bronx': 3,\n",
       "  'the Lower East Side': 1,\n",
       "  'Lower East Side': 2,\n",
       "  'South Bronx': 1,\n",
       "  'East 151st Street': 1,\n",
       "  'the Bronx Cold Case Squad': 1,\n",
       "  'Rikers Island': 1,\n",
       "  'Angel Island': 1,\n",
       "  'the Ellis Island': 1,\n",
       "  'the West Coast': 2,\n",
       "  'Gold Mountain': 1,\n",
       "  'Ellis Island': 1,\n",
       "  'Southern California': 2,\n",
       "  'Earth': 3,\n",
       "  'Delta': 2,\n",
       "  'West Coast': 1,\n",
       "  'Silicon Valley': 3,\n",
       "  'North': 9,\n",
       "  'Pacific': 1,\n",
       "  'the east coast': 1,\n",
       "  'the west coast': 1,\n",
       "  'Africa': 3,\n",
       "  'Asia': 7,\n",
       "  'South China Sea': 1,\n",
       "  'Central America': 2,\n",
       "  'the Silver Lake': 1,\n",
       "  'SoHo': 1,\n",
       "  'Sahara': 1,\n",
       "  'the Gulf of Mexico': 1,\n",
       "  'Jupiter': 1,\n",
       "  'Shutterfly': 1,\n",
       "  'the Upper East Side': 3,\n",
       "  'Coney Island': 1,\n",
       "  'Northeast': 1,\n",
       "  'Sheepshead Bay': 2,\n",
       "  'Yarra River': 1,\n",
       "  'the Green Bay Packers': 1,\n",
       "  'Green Bay': 2,\n",
       "  'New England': 2,\n",
       "  'Europe': 10,\n",
       "  'the Middle East': 1,\n",
       "  'Central Asia': 2,\n",
       "  'Federal Plaza': 1,\n",
       "  'the Hindu Kush': 1,\n",
       "  'Cobras': 1,\n",
       "  'the Rae Kushner Yeshiva High School': 1,\n",
       "  'Staten Island': 1,\n",
       "  'Capitol Hill': 1,\n",
       "  'Make America': 1,\n",
       "  'South America': 2,\n",
       "  'Middle America': 2,\n",
       "  'the Hudson River': 1,\n",
       "  'the Bronx River Parkway': 1,\n",
       "  'Caribbean': 3,\n",
       "  'West': 3,\n",
       "  'Barada Valley': 1,\n",
       "  'the Barada Valley': 1,\n",
       "  'Grindstone Island': 1,\n",
       "  'West Dawson': 2,\n",
       "  'the Yukon River': 1,\n",
       "  'the Klondike River': 1,\n",
       "  'the Missisquoi Valley': 1,\n",
       "  'the Eastern Townships': 1,\n",
       "  'Mystic': 2,\n",
       "  'Lake Michigan': 1,\n",
       "  'South Florida': 1,\n",
       "  'the Peruvian Andes': 1,\n",
       "  'Lake Titicaca': 1,\n",
       "  'Mediterranean': 2,\n",
       "  'the Galápagos Islands': 1,\n",
       "  'Crystal Bach': 1,\n",
       "  'the Hill District': 1,\n",
       "  'Kew Gardens': 1,\n",
       "  'the South Pacific': 1,\n",
       "  'the South China Sea': 2,\n",
       "  'the Pacific Coast': 1,\n",
       "  'Middle East': 1,\n",
       "  'the China App Store': 1,\n",
       "  'the North Cotabato District Jail': 1,\n",
       "  'the North Cotabato District': 1,\n",
       "  'the Isle of Wight': 1,\n",
       "  'Condé Nast Editions': 1,\n",
       "  'Condé Nast': 1,\n",
       "  'Eastern Europe': 1,\n",
       "  'East Coast': 1,\n",
       "  'the D. N. C.': 2,\n",
       "  'the North Koreans': 1,\n",
       "  'Guantánamo Bay': 1},\n",
       " 'ORDINAL': {'40th': 24,\n",
       "  'second': 21,\n",
       "  'first': 129,\n",
       "  'third': 9,\n",
       "  'fifth': 2,\n",
       "  'First': 6,\n",
       "  '45th': 1,\n",
       "  '72nd': 1,\n",
       "  '11th': 1,\n",
       "  'sixth': 2,\n",
       "  'fourth': 6,\n",
       "  '50th': 1,\n",
       "  '83rd': 1,\n",
       "  'eighth': 1,\n",
       "  '150th': 2,\n",
       "  '12th': 1,\n",
       "  '175th': 1,\n",
       "  '375th': 1,\n",
       "  '15th': 1,\n",
       "  '58th': 1},\n",
       " 'PRODUCT': {'Precinct': 8,\n",
       "  '300s': 1,\n",
       "  'Otis': 1,\n",
       "  'Potomac': 1,\n",
       "  'the “Star Wars': 1,\n",
       "  'Starburst': 1,\n",
       "  'the Velvet Underground': 1,\n",
       "  'Nova': 2,\n",
       "  'Twitter': 37,\n",
       "  'Rodgers': 1,\n",
       "  'Cowboys': 2,\n",
       "  'Raiders': 1,\n",
       "  'Broncos': 1,\n",
       "  'Palmyra': 1,\n",
       "  'Concorde': 1,\n",
       "  'Mattis': 12,\n",
       "  'Joint Base Andrews': 1,\n",
       "  'the S. A. R.': 1,\n",
       "  'Roxane Gay’s': 1,\n",
       "  'Cruze': 1,\n",
       "  'Obamacare': 1,\n",
       "  'Shadow': 1,\n",
       "  'Aleppo': 2,\n",
       "  'MSC Seaside': 1,\n",
       "  'Terminal 5': 1,\n",
       "  'Alessandro Scarafile': 1,\n",
       "  'Harris’s Stingray': 1,\n",
       "  'Ocean Compass': 1,\n",
       "  'the C. I. A.': 2,\n",
       "  'the U. S. intelligence': 1,\n",
       "  'Coie': 1,\n",
       "  'A. P. T. 28': 1,\n",
       "  'LionTree': 1,\n",
       "  'Autodata': 1,\n",
       "  '200': 1},\n",
       " 'TIME': {'hours': 7,\n",
       "  '12 hours': 1,\n",
       "  'Around 6:30 each morning': 1,\n",
       "  '8 hours 35 minutes': 1,\n",
       "  '36 hours': 1,\n",
       "  'overnight': 5,\n",
       "  'evening': 2,\n",
       "  'at least nine hours': 1,\n",
       "  'seven hours': 1,\n",
       "  '45 minutes': 3,\n",
       "  'another 45 minutes': 1,\n",
       "  '40 minutes': 1,\n",
       "  'an hour': 3,\n",
       "  'midnight': 3,\n",
       "  'two to three hours': 1,\n",
       "  'December night': 1,\n",
       "  'that night': 1,\n",
       "  'Just minutes': 1,\n",
       "  'several hours': 1,\n",
       "  'night': 9,\n",
       "  'this morning': 1,\n",
       "  'each morning': 2,\n",
       "  'half an hour': 1,\n",
       "  'noon': 3,\n",
       "  'before noon': 1,\n",
       "  'morning': 17,\n",
       "  'About an hour earlier': 1,\n",
       "  'a few minutes': 1,\n",
       "  'only two hours': 1,\n",
       "  'Wednesday night': 2,\n",
       "  'the next morning': 1,\n",
       "  '1:05': 1,\n",
       "  'the opening seconds': 1,\n",
       "  'around 3 o’clock in the morning': 1,\n",
       "  '3 o’clock in the afternoon': 1,\n",
       "  'the early hours': 1,\n",
       "  'mornings': 1,\n",
       "  '50 minutes of each hour': 1,\n",
       "  'up to 10 hours': 1,\n",
       "  'just after midnight': 1,\n",
       "  'the first minutes': 1,\n",
       "  'three hours': 3,\n",
       "  'Monday evening': 1,\n",
       "  'afternoon': 5,\n",
       "  'the 10 hours': 1,\n",
       "  'the 12 hours': 1,\n",
       "  'eight hours': 1,\n",
       "  'about 17 hours': 1,\n",
       "  'about eight minutes': 1,\n",
       "  'between long hours': 1,\n",
       "  'a weeknight': 1,\n",
       "  '12 minutes': 1,\n",
       "  'One night': 1,\n",
       "  'a recent weeknight': 1,\n",
       "  'a triumphant morning': 1,\n",
       "  'midmorning': 1,\n",
       "  'less than 24 hours': 1,\n",
       "  'About an hour later': 1,\n",
       "  'Hours later': 1,\n",
       "  'early hours': 1,\n",
       "  'Tuesday night': 1,\n",
       "  'Hours': 1,\n",
       "  'about six minutes later': 1,\n",
       "  '11 minutes': 1,\n",
       "  'five minutes every hour': 2,\n",
       "  '30 minutes': 1,\n",
       "  'the six hours': 1,\n",
       "  'each hour': 1,\n",
       "  'five minutes': 1,\n",
       "  'six uninterrupted hours': 1,\n",
       "  'early afternoon': 1,\n",
       "  'daytime': 7,\n",
       "  'daytime hours': 1,\n",
       "  'nights': 2,\n",
       "  '90 minutes': 1,\n",
       "  'a recent afternoon': 2,\n",
       "  'This morning': 1,\n",
       "  'midday': 1,\n",
       "  'An hour': 1,\n",
       "  'Later in the day': 1,\n",
       "  'nearly six hours': 1,\n",
       "  'only 24 hours': 1,\n",
       "  'about 90 minutes': 1,\n",
       "  '20 hours': 1,\n",
       "  'Three minutes': 1,\n",
       "  'the night of June 17, 2015': 1,\n",
       "  'five hours': 1,\n",
       "  'November night': 1,\n",
       "  'one morning': 2,\n",
       "  'just a moment': 1,\n",
       "  'just over four hours': 1,\n",
       "  'the morning': 2,\n",
       "  'All morning': 1,\n",
       "  '50 an hour': 1,\n",
       "  'two hours and 40 minutes': 1,\n",
       "  'a night': 1,\n",
       "  'working hours': 1,\n",
       "  'more than an hour': 1,\n",
       "  'hour': 1,\n",
       "  'his many hours': 1},\n",
       " 'FAC': {'East 146th Street': 2,\n",
       "  'Fernandez': 1,\n",
       "  'Courtlandt Avenue': 1,\n",
       "  'Union Square': 2,\n",
       "  'Gramercy Park': 1,\n",
       "  'Police Headquarters': 1,\n",
       "  'Angel Island Immigration Station': 1,\n",
       "  'Woods': 1,\n",
       "  'Pearl Harbor': 1,\n",
       "  'Broadway': 19,\n",
       "  'the Center for Strategic and International Studies': 1,\n",
       "  'the U. S. A.': 1,\n",
       "  'Westchester Avenue': 1,\n",
       "  'the Oval Office': 2,\n",
       "  'the Global C. C. S. Institute': 1,\n",
       "  'Disneyland': 1,\n",
       "  'Camp David': 1,\n",
       "  'Camp David’s': 1,\n",
       "  'Second Avenue': 6,\n",
       "  '96th Street': 3,\n",
       "  'Lexington Avenue': 1,\n",
       "  'Hudson Yards': 1,\n",
       "  '72nd Street': 1,\n",
       "  '125th Street': 1,\n",
       "  'City Hall': 2,\n",
       "  '86th Street': 2,\n",
       "  'Dylann S. Roof’s': 1,\n",
       "  'Port Phillip': 1,\n",
       "  'Times Square': 6,\n",
       "  'the Grand Palais': 2,\n",
       "  'Merton Park Studios': 1,\n",
       "  'the U. S.': 5,\n",
       "  'Guantánamo Bay': 1,\n",
       "  'Camp Whitehorse': 1,\n",
       "  'the Situation Room': 1,\n",
       "  'Barack Obama': 1,\n",
       "  'the Battle of Wanat': 1,\n",
       "  'Bagram Air Base': 1,\n",
       "  'the Container Store': 1,\n",
       "  'Calgary International Airport': 1,\n",
       "  'Rio de Janeiro': 1,\n",
       "  'Launchpad 39A': 1,\n",
       "  'the Kennedy Space Center': 1,\n",
       "  'Camp Dovid': 1,\n",
       "  '42nd Street': 1,\n",
       "  'Capitol': 2,\n",
       "  'the U. S. and': 1,\n",
       "  'the U. S. Louisa Adams': 1,\n",
       "  'the White House': 3,\n",
       "  'the F. C. C.': 1,\n",
       "  'the Panzhihua Land and Resources Bureau': 1,\n",
       "  'the Horace Mann School': 1,\n",
       "  'the Golden Gate Bridge': 1,\n",
       "  'Belmont Road': 1,\n",
       "  'the S. E. C.': 2,\n",
       "  'Taksim Square': 1,\n",
       "  'Stanford Prison Experiment': 1,\n",
       "  'Pike River': 1,\n",
       "  'Schönbrunn Palace': 1,\n",
       "  'MSC Cruises': 1,\n",
       "  'Great Trail': 1,\n",
       "  'the Samuel J. Friedman Theater': 1,\n",
       "  'the Barrymore Theater': 1,\n",
       "  'La Guardia Airport': 1,\n",
       "  'La Guardia': 5,\n",
       "  'Long Island Rail Road': 1,\n",
       "  'Vincenzetti': 1,\n",
       "  'the C. I. A. ’s': 1,\n",
       "  'the R. C. S.': 1,\n",
       "  'Silk Road': 1,\n",
       "  'the App Store': 1,\n",
       "  'the Rockefeller Foundation': 1,\n",
       "  'the D. N. C.': 7,\n",
       "  'the D. N. C. ’s': 1,\n",
       "  'the D. N. C. the committee': 1,\n",
       "  'the D. N. C. Nor': 1,\n",
       "  'the F. B. I.': 1,\n",
       "  'the D. N. C. The F. B. I.': 1,\n",
       "  'the D. N. C. and Podesta': 1,\n",
       "  'the N. S. A.': 1,\n",
       "  'the C. I. A.': 1,\n",
       "  'Guantánamo': 1,\n",
       "  'the Long Island Rail Road': 3,\n",
       "  'the Marketplace Mall': 1,\n",
       "  'the Oakdale Mall': 1,\n",
       "  'the Preakness Shopping Center': 1},\n",
       " 'QUANTITY': {'only about two square miles': 1,\n",
       "  'more than 100 feet': 1,\n",
       "  'only 90 miles': 1,\n",
       "  '400 miles': 1,\n",
       "  '300 pounds': 1,\n",
       "  '239 pounds': 1,\n",
       "  'just 191 pounds': 1,\n",
       "  'more than 100 pounds': 2,\n",
       "  '295 pounds': 1,\n",
       "  'hundreds of pounds': 1,\n",
       "  '263 pounds': 1,\n",
       "  '20 pounds': 1,\n",
       "  '444 pounds': 1,\n",
       "  'nearly 30 pounds': 1,\n",
       "  '370 pounds': 1,\n",
       "  'nine miles': 1,\n",
       "  '191 pounds': 1,\n",
       "  '255 pounds': 1,\n",
       "  'two pounds': 1,\n",
       "  'five pounds': 1,\n",
       "  'about 30 miles': 1,\n",
       "  '240 megawatts': 1,\n",
       "  '700 megawatts': 1,\n",
       "  '6 million tons': 1,\n",
       "  '5 billion miles': 1,\n",
       "  'hundreds of feet': 1,\n",
       "  '81 miles': 1,\n",
       "  'about 300 barrels': 1,\n",
       "  '50 miles': 1,\n",
       "  '50 megawatt': 1,\n",
       "  'Three miles': 2,\n",
       "  '4 feet': 1,\n",
       "  '3 feet': 1,\n",
       "  '12 miles': 1,\n",
       "  'minus 340 degrees': 1,\n",
       "  '40 degrees': 1,\n",
       "  'Several miles': 1,\n",
       "  'less than two miles': 1,\n",
       "  'millions of square miles': 1,\n",
       "  '300 miles': 1,\n",
       "  'less than 60 miles': 1,\n",
       "  '200 meters': 1,\n",
       "  'nearly 75 acres': 1,\n",
       "  'half a mile': 1,\n",
       "  'more than 10 miles per hour': 1},\n",
       " 'PERCENT': {'67 percent': 1,\n",
       "  '76 percent': 1,\n",
       "  '54 percent': 1,\n",
       "  '42 percent': 1,\n",
       "  '31 percent': 2,\n",
       "  '71 percent': 1,\n",
       "  '63 percent': 2,\n",
       "  '62 percent': 1,\n",
       "  '57 percent': 2,\n",
       "  '40 percent': 3,\n",
       "  '5 percent': 4,\n",
       "  '90 percent': 1,\n",
       "  '20 percent': 1,\n",
       "  '50 percent': 2,\n",
       "  '86 percent': 1,\n",
       "  'only 60 percent': 1,\n",
       "  '27 to 28 percent': 1,\n",
       "  'more than 8 percent': 1,\n",
       "  'more than 50 percent': 1,\n",
       "  '140 percent': 1,\n",
       "  '100 percent': 1,\n",
       "  'about 7 percent': 2,\n",
       "  '9 percent': 1,\n",
       "  '3 percent': 3,\n",
       "  '6 percent': 2,\n",
       "  '22 percent': 2,\n",
       "  'Forty percent': 1,\n",
       "  '75 percent': 2,\n",
       "  'roughly 74 percent': 1,\n",
       "  '70 percent': 1,\n",
       "  '96 percent': 1,\n",
       "  '98 percent': 1,\n",
       "  'about 90 percent': 1,\n",
       "  '10 percent': 3,\n",
       "  'Two percent': 1,\n",
       "  '17 percent': 1,\n",
       "  'about 2 percent': 1,\n",
       "  '15 percent': 1,\n",
       "  'More than 70 percent': 1,\n",
       "  'at least 12 percent': 1,\n",
       "  'as much as 8 percent': 1,\n",
       "  'only 10 percent': 1,\n",
       "  'about 25 percent': 1,\n",
       "  'about 3 percent': 1,\n",
       "  '0. 4 percent': 1,\n",
       "  'nearly 17 percent': 1,\n",
       "  'about 12 percent': 1,\n",
       "  'less than 1 percent': 1,\n",
       "  '2 percent': 2,\n",
       "  '1 percent': 1,\n",
       "  'nearly 10 percent': 1},\n",
       " 'WORK_OF_ART': {'When de Blasio': 1,\n",
       "  '40th and PSA 7': 1,\n",
       "  'Bambi': 9,\n",
       "  'The Sands of Iwo Jima': 1,\n",
       "  'Rebel Without a Cause': 1,\n",
       "  'The Wild Bunch': 1,\n",
       "  'Water to Paper': 2,\n",
       "  'Tyrus': 3,\n",
       "  'Snow White': 1,\n",
       "  'Walt Disney': 1,\n",
       "  'Before the Animation Begins: The Art and Lives of Disney Inspirational Sketch Artists': 1,\n",
       "  'Olympic': 2,\n",
       "  'Russell': 1,\n",
       "  'Harry Potter': 1,\n",
       "  'Godfather': 1,\n",
       "  'Adventures of Superman': 1,\n",
       "  'Mister Ed': 1,\n",
       "  'The Man From U. N. C. L. E. ”': 1,\n",
       "  'The Patty Duke Show': 1,\n",
       "  'The Life and Times of Grizzly Adams': 1,\n",
       "  'The Brady Bunch': 1,\n",
       "  'Growing Pains': 1,\n",
       "  'Happy Days': 1,\n",
       "  'Mork  Mindy': 1,\n",
       "  'Laverne  Shirley': 1,\n",
       "  'ICBM': 1,\n",
       "  'The Queen': 1,\n",
       "  'The Biggest Loser': 3,\n",
       "  'These Days': 1,\n",
       "  'Girls': 2,\n",
       "  'Trainwreck': 1,\n",
       "  'New Girl': 1,\n",
       "  'Survivor’s Remorse': 1,\n",
       "  'Love Me Again': 1,\n",
       "  'Need Your Love So Bad': 1,\n",
       "  'BedBedBedBedBed': 1,\n",
       "  'Feynman Diagrams for All': 1,\n",
       "  'I’ve Been Let Down': 1,\n",
       "  'Christmas Card From a Hooker': 1,\n",
       "  'Once, With Feeling': 1,\n",
       "  'Pulitzer Prize': 1,\n",
       "  'Exelon Generation': 1,\n",
       "  'Sunset Boulevard': 1,\n",
       "  'Citizen Kane': 1,\n",
       "  'Morning Joe': 1,\n",
       "  'My Way': 1,\n",
       "  'Fiddler on the Roof': 1,\n",
       "  'It’s 5 o’clock': 2,\n",
       "  'Trump': 2,\n",
       "  'Today Mahatma Gandhi': 1,\n",
       "  'Fair': 1,\n",
       "  'Emotions': 1,\n",
       "  'Dick Clark’s': 2,\n",
       "  'In very rare instances': 1,\n",
       "  'Auld Lang Syne': 1,\n",
       "  'Eternal Sites: From Bamiyan to Palmyra': 1,\n",
       "  'History Begins': 1,\n",
       "  'Freedom! ’90': 3,\n",
       "  'Listen Without Prejudice Vol': 1,\n",
       "  'Freedom!': 2,\n",
       "  'Freedom': 5,\n",
       "  'Working Girl': 1,\n",
       "  'Vogue': 1,\n",
       "  'Truth or Dare': 1,\n",
       "  'Faith': 1,\n",
       "  'Open Your Heart': 1,\n",
       "  'The Professor': 1,\n",
       "  'I Can’t Drive 55': 1,\n",
       "  'Nobel Peace Prize': 1,\n",
       "  'Made in America': 1,\n",
       "  'Motherless Brooklyn': 3,\n",
       "  'The Fortress of Solitude': 3,\n",
       "  'A Gambler’s Anatomy': 1,\n",
       "  'The Warriors': 1,\n",
       "  'Jerks From Nowhere': 1,\n",
       "  'Apes in the Plan': 1,\n",
       "  'Gun, With Occasional Music': 1,\n",
       "  'the Affordable Care Act': 3,\n",
       "  '‘The White Tiger’': 1,\n",
       "  'Difficult Women': 1,\n",
       "  'Americanness': 1,\n",
       "  'The Apprentice': 1,\n",
       "  'Bridgegate': 1,\n",
       "  'Schumer': 1,\n",
       "  'Azaria’s': 1,\n",
       "  'Your Money': 1,\n",
       "  'The Kelly File': 2,\n",
       "  '60 Minutes': 7,\n",
       "  'CBS Sunday Morning': 1,\n",
       "  'Beyond the Tank': 1,\n",
       "  'Days of Our Lives': 1,\n",
       "  'The Ellen DeGeneres Show': 1,\n",
       "  'Steve Harvey': 1,\n",
       "  'Rock Center': 1,\n",
       "  'Sunday Night Football': 1,\n",
       "  'Dateline': 1,\n",
       "  'Outnumbered': 1,\n",
       "  'The Five': 1,\n",
       "  '“The Age of Reform': 1,\n",
       "  'God and Man at': 1,\n",
       "  'A Time for Choosing': 1,\n",
       "  'The Revolt of the Elites': 1,\n",
       "  'Twilight of the Elites': 1,\n",
       "  'A Gentleman’s Guide to Love and Murder': 1,\n",
       "  'Fall in Love': 1,\n",
       "  'Today is the day': 1,\n",
       "  'Sábado Gigante': 1,\n",
       "  'Step Up': 1,\n",
       "  'The Affordable Care Act': 1,\n",
       "  'Affordable Care Act': 1,\n",
       "  'earmarks': 1,\n",
       "  'Bible': 1,\n",
       "  'Tywanza Sanders': 1,\n",
       "  'America Chief Suspect': 1,\n",
       "  'Do Not Say We Have Nothing': 1,\n",
       "  'Walkaway': 1,\n",
       "  'Paris of the North': 1,\n",
       "  'How Festive the Ambulance': 1,\n",
       "  'The Sound of Living Things': 1,\n",
       "  'Summer Night Concert Schönbrunn': 1,\n",
       "  'Aida': 1,\n",
       "  'Another Brick': 1,\n",
       "  'The Wall': 1,\n",
       "  'The Humans': 2,\n",
       "  'The Piano Lesson': 1,\n",
       "  'Platonov': 1,\n",
       "  'How Are Things': 1,\n",
       "  'The Fever': 1,\n",
       "  'a Tony Award': 1,\n",
       "  'Jimmy Page': 1,\n",
       "  'B Side': 1,\n",
       "  'Going Dark': 1,\n",
       "  'Labor’s Love Lost: The Rise and Fall': 1,\n",
       "  'Reshaping the   Debate:': 1,\n",
       "  'White   ': 1,\n",
       "  'As long as bigger': 1,\n",
       "  'Ocean Medallion': 1,\n",
       "  'The Voyager with': 1,\n",
       "  'Titanic: The New Evidence': 1,\n",
       "  'A Night to Remember': 1,\n",
       "  '“The Irish Aboard Titanic': 1,\n",
       "  'Jersey Boys': 2,\n",
       "  'The Lion King': 2,\n",
       "  'Oh, Hello': 1,\n",
       "  'The Illusionists': 2,\n",
       "  'The Phantom of the Opera': 1,\n",
       "  'A Bronx Tale': 1,\n",
       "  'Dear Evan Hansen': 1,\n",
       "  'Matilda': 1,\n",
       "  'Taxi': 1,\n",
       "  'Alice': 1,\n",
       "  'Chico and the Man': 1,\n",
       "  'Laverne and Shirley': 1,\n",
       "  'All in the Family': 2,\n",
       "  'The Middle': 1,\n",
       "  'Deadliest Catch': 1,\n",
       "  'Fuller House': 1,\n",
       "  'Gilmore Girls': 1,\n",
       "  'Don’t Go Breaking My Heart': 1,\n",
       "  'The Mary Tyler Moore Show': 1,\n",
       "  'Six Feet Under': 1,\n",
       "  'The Ranch': 1,\n",
       "  'Roseanne': 1,\n",
       "  'Tears We Cannot Stop': 1,\n",
       "  'A Sermon to White America': 1,\n",
       "  'Around That Time:': 1,\n",
       "  'Purple Rain': 1,\n",
       "  'the Dukes': 2,\n",
       "  'Facebook': 1,\n",
       "  'Moonlight Maze  ': 1,\n",
       "  'cyber Pearl Harbor': 1,\n",
       "  'The D. N. C.': 1,\n",
       "  'False': 1,\n",
       "  'Shadow Brokers': 1,\n",
       "  'The Godfather': 1,\n",
       "  'Why American Elections Are Flawed': 1,\n",
       "  'The U. S.': 1,\n",
       "  'As the C. E. O. of MF Global': 1},\n",
       " 'EVENT': {'World Wars': 1,\n",
       "  'World War II': 2,\n",
       "  'the Vietnam War': 3,\n",
       "  'the Vietnam War’s': 1,\n",
       "  'New Year’s Day': 6,\n",
       "  'New Year’s': 8,\n",
       "  'the Communist Revolution of 1949': 1,\n",
       "  'Vietnam War': 1,\n",
       "  'the Paris Agreement': 1,\n",
       "  'New Year’s Eve': 8,\n",
       "  'the New Year': 1,\n",
       "  'Green Bay Packers': 1,\n",
       "  'the Super Bowl': 1,\n",
       "  'Super Bowl': 1,\n",
       "  'Olympics': 2,\n",
       "  'Corinne Day': 1,\n",
       "  'Falcon 9': 1,\n",
       "  'the New Year’s': 1,\n",
       "  'the Iraq war': 2,\n",
       "  'the Vietnam War  ': 1,\n",
       "  'the Westchester Summer Day': 1,\n",
       "  'Selection Day': 1,\n",
       "  'World Cup': 1,\n",
       "  'the 2018 World Cup': 1,\n",
       "  'New Year': 1,\n",
       "  'the American Revolution': 1,\n",
       "  'Dom Pérignon Rosé': 1,\n",
       "  'World War I': 1,\n",
       "  'the Revolutionary War': 1,\n",
       "  'the Salzburg Festival': 1,\n",
       "  'the       Joie de Vivre': 1,\n",
       "  'Hell Week': 1,\n",
       "  'the Arab Spring': 2,\n",
       "  'Vincenzetti': 1,\n",
       "  'the Ocean Medallion': 1,\n",
       "  'Ocean Medallion': 1,\n",
       "  'Watergate': 1,\n",
       "  'the Cold War days': 1,\n",
       "  'Inauguration Day': 1,\n",
       "  'the Civil War': 1},\n",
       " 'LANGUAGE': {'English': 3, 'Russian': 2}}"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "named_entities   "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "100"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "len(processed_docs)"
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Better way to print the Entity Types and Values\n",
    "\n",
    "In this code, you print out the type of a named entity (e.g., ORG) and for each type, you extract all entities assigned with this type in the dictionary, sorted by their frequency in descending order. \n",
    "\n",
    "Print out the most frequent 10 entities per type"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "GPE\n",
      " the United States: 81\n",
      " China: 61\n",
      " Russia: 50\n",
      " Washington: 48\n",
      " Afghanistan: 42\n",
      " Turkey: 40\n",
      " New York: 38\n",
      " America: 31\n",
      " Manhattan: 30\n",
      " Iraq: 28\n",
      "NORP\n",
      " Republicans: 138\n",
      " American: 136\n",
      " Republican: 67\n",
      " Democrats: 60\n",
      " Russian: 59\n",
      " Chinese: 48\n",
      " Democratic: 31\n",
      " Americans: 26\n",
      " Russians: 24\n",
      " Democrat: 23\n",
      "PERSON\n",
      " Trump: 255\n",
      " Obama: 114\n",
      " Roof: 41\n",
      " Kelly: 39\n",
      " Donald J. Trump: 37\n",
      " Wong: 31\n",
      " Clinton: 30\n",
      " Kerr: 27\n",
      " Netanyahu: 25\n",
      " Leahy: 24\n",
      "ORG\n",
      " House: 84\n",
      " Senate: 69\n",
      " Congress: 68\n",
      " Hacking Team: 35\n",
      " the White House: 31\n",
      " Times: 27\n",
      " Apple: 25\n",
      " Hacking Team’s: 24\n",
      " Trump: 23\n",
      " NBC: 20\n",
      "MONEY\n",
      " 1: 9\n",
      " billions of dollars: 5\n",
      " 2: 5\n",
      " 3: 4\n",
      " more than $1 billion: 3\n",
      " the billions of dollars: 3\n",
      " 100: 3\n",
      " millions of dollars: 3\n",
      " tens of millions: 3\n",
      " $5 million: 3\n",
      "CARDINAL\n",
      " one: 122\n",
      " two: 91\n",
      " 000: 53\n",
      " three: 40\n",
      " One: 34\n",
      " Five: 24\n",
      " 2: 23\n",
      " four: 21\n",
      " 1: 19\n",
      " 10: 14\n",
      "DATE\n",
      " Wednesday: 50\n",
      " Tuesday: 42\n",
      " 2015: 36\n",
      " last year: 32\n",
      " 2016: 32\n",
      " Sunday: 32\n",
      " Thursday: 32\n",
      " years: 30\n",
      " this year: 29\n",
      " Monday: 23\n",
      "LAW\n",
      " the Affordable Care Act: 12\n",
      " Constitution: 3\n",
      "LOC\n",
      " Europe: 10\n",
      " North: 9\n",
      " Asia: 7\n",
      " the South Bronx: 3\n",
      " Earth: 3\n",
      " Silicon Valley: 3\n",
      " Africa: 3\n",
      " the Upper East Side: 3\n",
      " Caribbean: 3\n",
      " West: 3\n",
      "ORDINAL\n",
      " first: 129\n",
      " 40th: 24\n",
      " second: 21\n",
      " third: 9\n",
      " First: 6\n",
      " fourth: 6\n",
      " fifth: 2\n",
      " sixth: 2\n",
      " 150th: 2\n",
      "PRODUCT\n",
      " Twitter: 37\n",
      " Mattis: 12\n",
      " Precinct: 8\n",
      " Nova: 2\n",
      " Cowboys: 2\n",
      " Aleppo: 2\n",
      " the C. I. A.: 2\n",
      "TIME\n",
      " morning: 17\n",
      " night: 9\n",
      " hours: 7\n",
      " daytime: 7\n",
      " overnight: 5\n",
      " afternoon: 5\n",
      " 45 minutes: 3\n",
      " an hour: 3\n",
      " midnight: 3\n",
      " noon: 3\n",
      "FAC\n",
      " Broadway: 19\n",
      " the D. N. C.: 7\n",
      " Second Avenue: 6\n",
      " Times Square: 6\n",
      " the U. S.: 5\n",
      " La Guardia: 5\n",
      " 96th Street: 3\n",
      " the White House: 3\n",
      " the Long Island Rail Road: 3\n",
      " East 146th Street: 2\n",
      "QUANTITY\n",
      " more than 100 pounds: 2\n",
      " Three miles: 2\n",
      "PERCENT\n",
      " 5 percent: 4\n",
      " 40 percent: 3\n",
      " 3 percent: 3\n",
      " 10 percent: 3\n",
      " 31 percent: 2\n",
      " 63 percent: 2\n",
      " 57 percent: 2\n",
      " 50 percent: 2\n",
      " about 7 percent: 2\n",
      " 6 percent: 2\n",
      "WORK_OF_ART\n",
      " Bambi: 9\n",
      " 60 Minutes: 7\n",
      " Freedom: 5\n",
      " Tyrus: 3\n",
      " The Biggest Loser: 3\n",
      " Freedom! ’90: 3\n",
      " Motherless Brooklyn: 3\n",
      " The Fortress of Solitude: 3\n",
      " the Affordable Care Act: 3\n",
      " Water to Paper: 2\n",
      "EVENT\n",
      " New Year’s: 8\n",
      " New Year’s Eve: 8\n",
      " New Year’s Day: 6\n",
      " the Vietnam War: 3\n",
      " World War II: 2\n",
      " Olympics: 2\n",
      " the Iraq war: 2\n",
      " the Arab Spring: 2\n",
      "LANGUAGE\n",
      " English: 3\n",
      " Russian: 2\n"
     ]
    }
   ],
   "source": [
    "def print_top_10(named_entities):\n",
    "    for key in named_entities.keys():        \n",
    "        print(key)\n",
    "        entities = named_entities.get(key)\n",
    "                \n",
    "        # Sort the entries by their frequency in descending \n",
    "        # order and print out the most frequent n ones\n",
    "        sorted_keys = sorted(entities, key=entities.get, reverse=True )\n",
    "        for item in sorted_keys[:10]:\n",
    "            if (entities.get(item) > 1 ):\n",
    "                print(\" \" + item + \": \" + str(entities.get(item)))\n",
    "                \n",
    "print_top_10(named_entities)\n",
    "        "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "dict_keys(['GPE', 'NORP', 'PERSON', 'ORG', 'MONEY', 'CARDINAL', 'DATE', 'LAW', 'LOC', 'ORDINAL', 'PRODUCT', 'TIME', 'FAC', 'QUANTITY', 'PERCENT', 'WORK_OF_ART', 'EVENT', 'LANGUAGE'])"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "named_entities.keys()"
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### Interpretation of the above\n",
    "\n",
    "As this table shows, the most frequently used named entities in the news articles are entities of the following types: PERSON, GPE, ORG, and DATE. This is, perhaps, not very surprising: after all, most often news report on the events that are related to people (PERSON), companies (ORG), countries (GPE), and usually news articles include references to specific dates.\n",
    "\n",
    "------------------------------\n",
    "\n",
    "# Extracting the subject (the entity that performs the action) or an object (an entity to which the action applies)\n",
    "\n",
    "\n",
    "----------\n",
    "\n",
    "Suppose your named entity of interest is a multi-word expression **The New York Times** \n",
    "\n",
    "And the full sentence is **“The New York Times wrote about Apple”**. \n",
    "\n",
    "#### And from the above we know that indeed, The New York Times as a whole is the subject – it is the entity that performed the action of writing.\n",
    "\n",
    "### So the problem is - How can you extract the whole expression \"The New York Times?\"\n",
    "\n",
    "----------\n",
    "\n",
    "### Overall Solution Approach\n",
    "\n",
    "1. **So the first step of the solution is**, you first identify the indexes of the words covered by this expression in the sentence: for \"The New York Times\" these are [0, 1, 2, 3], as the left part. \n",
    "\n",
    "\n",
    "2. Next, i.e. the second half of the task, you check if a word with any of these indexes plays a role of the subject or an object in the sentence. \n",
    "\n",
    "3. And we see that, indeed, the word that is the subject in the sentence has the index of 3 . \n",
    "\n",
    "4. Therefore, you can return the whole named entity \"The New York Times\" as the subject of the main action in the sentence.\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [],
   "source": [
    "def calculate_entity_span(document, entity):\n",
    "    \"\"\"\n",
    "    Calculate the span of a named entity in a document.\n",
    "\n",
    "    Args:\n",
    "        document (spacy.tokens.Doc): The document to search for the entity.\n",
    "        entity (str): The entity to find in the document.\n",
    "\n",
    "    Returns:\n",
    "        list: A list of indices representing the span of the entity in the document.\n",
    "    \"\"\"\n",
    "    # Initialize a list to hold the indices\n",
    "    indexes = []\n",
    "    \n",
    "    # Iterate over the entities in the document\n",
    "    for ent in document.ents:\n",
    "        # If the entity text matches the entity we're looking for...\n",
    "        if ent.text == entity:\n",
    "            # Iterate over the range from the entity's start to its end\n",
    "            for i in range(int(ent.start), int(ent.end)):\n",
    "                # Append the index to the list\n",
    "                indexes.append(i)\n",
    "                \n",
    "    # Return the list of indices\n",
    "    return indexes\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[0, 1, 2, 3]"
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "entity = \"The New York Times\"\n",
    "\n",
    "sentences = \"The New York Times wrote about Apple\"\n",
    "\n",
    "doc = nlp(sentences)\n",
    "\n",
    "calculate_entity_span(doc, entity)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "det\n",
      "compound\n",
      "compound\n",
      "nsubj\n",
      "ROOT\n",
      "prep\n",
      "pobj\n"
     ]
    }
   ],
   "source": [
    "sentences = [\"The New York Times wrote about Apple\"]\n",
    "\n",
    "for sentence in sentences:\n",
    "    doc = nlp(sentence)\n",
    "    for token in doc:\n",
    "        print(token.dep_)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {},
   "outputs": [],
   "source": [
    "def calc_entity_subject_object(document, entity, indexes):\n",
    "    \"\"\"\n",
    "    Analyze a document to find actions related to a specific entity.\n",
    "\n",
    "    Args:\n",
    "        document (spacy.tokens.Doc): The document to analyze.\n",
    "        entity (str): The entity to find actions for.\n",
    "        indexes (list): A list of indices in the document where the entity appears.\n",
    "\n",
    "    Returns:\n",
    "        None: Prints out the sentence and all actions involving the entity.\n",
    "    \"\"\"\n",
    "    actions = []\n",
    "    action = ''\n",
    "    participant1 = ''\n",
    "    participant2 = ''\n",
    "    \n",
    "    for token in document:\n",
    "        # Next, you identify the main verb expressing the main action in the sentence\n",
    "        # To extract the relation, we have to find the ROOT of the sentence (which is also the verb of the sentence)\n",
    "        if token.pos_ == \"VERB\" and token.dep_ == 'ROOT':\n",
    "            # Initialize the indexes for the subject and the object related to the main verb\n",
    "            subj_ind = -1\n",
    "            obj_ind = -1\n",
    "            # Store the main verb itself (token.text) in the action variable\n",
    "            action = token.text\n",
    "            children = [child for child in token.children ]\n",
    "            for child1 in children:\n",
    "                # Find the subject via the nsubj relation and store it as participant1 \n",
    "                # and its index as subj_ind\n",
    "                if child1.dep_ == 'nsubj':\n",
    "                    participant1 = child1.text\n",
    "                    subj_ind = int(child1.i)\n",
    "                # If there is a preposition attached to the verb (e.g., “write about”), then\n",
    "                # you need to search for the indirect object as the second participant. \n",
    "                if child1.dep_ == 'prep':\n",
    "                    participant2 = ''\n",
    "                    child1_children = [child for child in child1.children]\n",
    "                    for child2 in child1_children:\n",
    "                        # If such an object is a noun or a proper noun, \n",
    "                        # you store it as participant2 and its index as obj_ind\n",
    "                        if child2.pos_ == 'NOUN' or child2.pos_ == 'PROPN':\n",
    "                            participant2 = child2.text\n",
    "                            obj_ind = int(child2.i)\n",
    "                    \n",
    "                    # If at this point both participants of the main action have been identified and\n",
    "                    # their indexes are included in the indexes of the words covered by the entity, \n",
    "                    # you add the action with two participants to the list of actions.\n",
    "                    if not participant2==\"\":\n",
    "                        if subj_ind in indexes:\n",
    "                            actions.append(entity + \" \" + action + \" \" + child1.text + \" \" + participant2)\n",
    "                        elif obj_ind in indexes:\n",
    "                            actions.append(participant1 + \" \" + action + \" \" + child1.text + \" \" + entity)\n",
    "                            \n",
    "                # Otherwise, if there is no preposition attached to the verb,\n",
    "                # participant2 is a direct object of the main verb, \n",
    "                # which can be identified via the dobj relation\n",
    "                if child1.dep_ == 'dobj' and (child1.pos_ == 'NOUN' or child1.pos_ == 'PROPN' ):\n",
    "                    participant2 = child1.text\n",
    "                    obj_ind = int(child1.i)\n",
    "                    # In this case, you apply the same strategy as above, \n",
    "                    # adding the action with two participants to the list of actions. \n",
    "                    if subj_ind in indexes:\n",
    "                         actions.append(entity + \" \" + action + \" \" + participant2)\n",
    "                    elif obj_ind in indexes:\n",
    "                        actions.append(participant1 + \" \" + action + \" \" + entity)\n",
    "    # Finally if the final list of actions is not empty, \n",
    "    # Print out the sentence and all actions together with the participants.\n",
    "    if not len(actions) == 0:\n",
    "        print(f\"\\nSentence = {document}\")\n",
    "        for item in actions:\n",
    "            print(item)            "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "Sentence = The New York Times wrote about Apple\n",
      "Times wrote about Apple\n"
     ]
    }
   ],
   "source": [
    "for sentence in sentences:\n",
    "    doc = nlp(sentence)\n",
    "    indexes = calculate_entity_span(doc, entity)\n",
    "    calc_entity_subject_object(doc, entity, indexes)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[American tech giants like Google, Apple and Facebook are on a collision course with European regulators over issues including privacy and taxes., Nearly a year ago, I argued that we were witnessing a new era in the tech business, one that is typified less by the storied   in a garage than by a posse I like to call the Frightful Five: Amazon, Apple, Facebook, Microsoft and Alphabet, Google’s parent company., The precise nature of the fights varies by company and region, including the tax and antitrust investigations of Apple and Google in Europe and Donald J. Trump’s broad and often incoherent criticism of the Five for various alleged misdeeds., Apple’s sales were flat last year, and after a monster 2016, Alphabet’s stock price hit a plateau., When Apple took on the Federal Bureau of Investigation last year over access to a terrorist’s iPhone, many in tech sided with the company, but a majority of Americans thought Apple should give in., He promised to force Apple to make iPhones in America., In a 2014 address, now referred to in cybersecurity circles as his “Going Dark” speech, the F. B. I. ’s director, James Comey, argued that the encryption built into Apple products posed a threat to public safety  —   enabling not only terrorism but also drug trafficking, child abuse and   ., Apple, complying with what it said was a request from Chinese authorities, removed news apps created by The New York Times from its app store in China late last month., Apple removed both the   and   apps from the app store in China on Dec. 23., “For some time now the New York Times app has not been permitted to display content to most users in China and we have been informed that the app is in violation of local regulations,” Fred Sainz, an Apple spokesman, said of the Times apps., Mr. Sainz declined to comment on what local regulations the Times apps were said to have violated, who had contacted Apple and when, and whether a court order or other legal document had been presented., A Times spokeswoman in New York, Eileen Murphy, said the company had asked Apple to reconsider its decision., Apple has previously removed other, less prominent media apps from its China store., Apple’s chief executive, Timothy D. Cook, has said that the company complies with all local laws., While in early 2016 Apple resisted a court request in the United States for it to help federal officials unlock an iPhone for a criminal investigation, Mr. Cook said he would obey whatever order the court ultimately handed down., In the end, the government was able to unlock the device without Apple’’s help and the case was dropped., Farzana Aslam, associate director of the Center for Comparative and Public Law at the University of Hong Kong, noted that in matters involving customer privacy, Apple requires governments to submit subpoenas, search warrants or other legal documents., She added that it was “very worrying” that Apple had not disclosed what laws the authorities said were violated, making it difficult for The Times and other publishers to file an appeal or challenge the government’s requests., China is also one of Apple’s largest iPhone markets, though sales in that region have slowed., On Dec. 23, David Barboza, a Times reporter, spoke with members of Apple’s media team about the article., Later that day, a separate team from Apple informed The Times that the apps would be removed, Ms. Murphy said., The Times news apps remain available in Apple’s app stores for other countries, as well as the Hong Kong and Taiwan stores, but people must have a credit card with a billing address outside mainland China to download them., Apple’s decision to remove the app from its China store should not affect those who have already installed it., Mr. Natkin said that Apple had a certain amount of leverage against the Chinese government in terms of the total amount of jobs created but that “the technology gap has started to close. ”]\n"
     ]
    }
   ],
   "source": [
    "def return_docs_of_given_ent_type(processed_docs, entity, ent_type):\n",
    "    \"\"\"\n",
    "    Extracts sentences from a list of processed documents that contain a given named entity of a specific type.\n",
    "\n",
    "    Args:\n",
    "        processed_docs (list): A list of processed documents. Each document is a spacy.tokens.Doc object.\n",
    "        entity (str): The named entity to search for.\n",
    "        ent_type (str): The type of the named entity (e.g. 'ORG', 'PERSON', 'GPE')\n",
    "\n",
    "    Returns:\n",
    "        output_sentences (list): A list of sentences containing the named entity of the specified type.\n",
    "    \"\"\"\n",
    "    output_sentences = []\n",
    "    for doc in processed_docs:\n",
    "        for sentence in doc.sents:\n",
    "            # Only consider sentences that contain the input entity \n",
    "            # of the specified type among its named entities\n",
    "            if entity in [ent.text for ent in sentence.ents if ent.label_ == ent_type ]:\n",
    "                output_sentences.append(sentence)\n",
    "    return output_sentences\n",
    "\n",
    "entity = \"Apple\"\n",
    "\n",
    "ent_sentences = return_docs_of_given_ent_type(processed_docs, entity, 'ORG' )\n",
    "print(ent_sentences)        \n",
    "        "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "Sentence = Apple, complying with what it said was a request from Chinese authorities, removed news apps created by The New York Times from its app store in China late last month.\n",
      "Apple removed apps\n",
      "\n",
      "Sentence = Apple removed both the   and   apps from the app store in China on Dec. 23.\n",
      "Apple removed from store\n",
      "Apple removed on Dec.\n",
      "\n",
      "Sentence = Apple has previously removed other, less prominent media apps from its China store.\n",
      "Apple removed apps\n",
      "Apple removed from store\n"
     ]
    }
   ],
   "source": [
    "for sentence in ent_sentences:\n",
    "    indexes = calculate_entity_span(sentence, entity)\n",
    "    calc_entity_subject_object(sentence, entity, indexes)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "13\n",
      "\n",
      "Sentence = During negotiations with Mr. Corzine last year, the commission also strengthened aspects of the deal after some of the agency’s commissioners questioned it, The New York Times reported at the time.\n",
      "The New York Times reported at time\n"
     ]
    }
   ],
   "source": [
    "entity = \"The New York Times\"\n",
    "\n",
    "ent_sentences = return_docs_of_given_ent_type(processed_docs, entity, \"ORG\")\n",
    "print(len(ent_sentences))\n",
    "\n",
    "for sentence in ent_sentences:\n",
    "    indexes = calculate_entity_span(sentence, entity)\n",
    "    calc_entity_subject_object(sentence, entity, indexes)"
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Apply visualization with displaCy"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<span class=\"tex2jax_ignore\"><div class=\"entities\" style=\"line-height: 2.5; direction: ltr\">\n",
       "<mark class=\"entity\" style=\"background: #bfe1d9; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n",
       "    Last week\n",
       "    <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">DATE</span>\n",
       "</mark>\n",
       ", \n",
       "<mark class=\"entity\" style=\"background: #c887fb; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n",
       "    Democratic\n",
       "    <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">NORP</span>\n",
       "</mark>\n",
       " lawmakers from both parties said they had the \n",
       "<mark class=\"entity\" style=\"background: #7aecec; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n",
       "    Senate\n",
       "    <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">ORG</span>\n",
       "</mark>\n",
       " votes needed to pass legislation that would prevent tech platforms, including \n",
       "<mark class=\"entity\" style=\"background: #7aecec; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n",
       "    Apple\n",
       "    <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">ORG</span>\n",
       "</mark>\n",
       ", \n",
       "<mark class=\"entity\" style=\"background: #7aecec; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n",
       "    GM\n",
       "    <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">ORG</span>\n",
       "</mark>\n",
       " and \n",
       "<mark class=\"entity\" style=\"background: #7aecec; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n",
       "    Facebook\n",
       "    <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">ORG</span>\n",
       "</mark>\n",
       ", from favoring their own businesses.</div></span>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "from spacy import displacy\n",
    "\n",
    "text = \"Last week, Democratic lawmakers from both parties said they had the Senate votes needed to pass legislation that would prevent tech platforms, including Apple, GM and Facebook, from favoring their own businesses.\"\n",
    "\n",
    "doc = nlp(text)\n",
    "\n",
    "displacy.render(doc, style=\"ent\")"
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Visualize entity types in sentences containing the specified entity:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<span class=\"tex2jax_ignore\"><div class=\"entities\" style=\"line-height: 2.5; direction: ltr\">\n",
       "<mark class=\"entity\" style=\"background: #c887fb; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n",
       "    American\n",
       "    <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">NORP</span>\n",
       "</mark>\n",
       " tech giants like \n",
       "<mark class=\"entity\" style=\"background: #7aecec; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n",
       "    Google\n",
       "    <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">ORG</span>\n",
       "</mark>\n",
       ", \n",
       "<mark class=\"entity\" style=\"background: #7aecec; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n",
       "    Apple\n",
       "    <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">ORG</span>\n",
       "</mark>\n",
       " and Facebook are on a collision course with \n",
       "<mark class=\"entity\" style=\"background: #c887fb; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n",
       "    European\n",
       "    <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">NORP</span>\n",
       "</mark>\n",
       " regulators over issues including privacy and taxes. </div></span>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<span class=\"tex2jax_ignore\"><div class=\"entities\" style=\"line-height: 2.5; direction: ltr\">\n",
       "<mark class=\"entity\" style=\"background: #bfe1d9; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n",
       "    Nearly a year ago\n",
       "    <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">DATE</span>\n",
       "</mark>\n",
       ", I argued that we were witnessing a new era in the tech business, one that is typified less by the storied   in a garage than by a posse I like to call the Frightful \n",
       "<mark class=\"entity\" style=\"background: #e4e7d2; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n",
       "    Five\n",
       "    <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">CARDINAL</span>\n",
       "</mark>\n",
       ": \n",
       "<mark class=\"entity\" style=\"background: #7aecec; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n",
       "    Amazon\n",
       "    <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">ORG</span>\n",
       "</mark>\n",
       ", \n",
       "<mark class=\"entity\" style=\"background: #7aecec; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n",
       "    Apple\n",
       "    <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">ORG</span>\n",
       "</mark>\n",
       ", \n",
       "<mark class=\"entity\" style=\"background: #7aecec; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n",
       "    Facebook\n",
       "    <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">ORG</span>\n",
       "</mark>\n",
       ", \n",
       "<mark class=\"entity\" style=\"background: #7aecec; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n",
       "    Microsoft\n",
       "    <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">ORG</span>\n",
       "</mark>\n",
       " and \n",
       "<mark class=\"entity\" style=\"background: #7aecec; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n",
       "    Alphabet, Google’s\n",
       "    <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">ORG</span>\n",
       "</mark>\n",
       " parent company. </div></span>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<span class=\"tex2jax_ignore\"><div class=\"entities\" style=\"line-height: 2.5; direction: ltr\">The precise nature of the fights varies by company and region, including the tax and antitrust investigations of \n",
       "<mark class=\"entity\" style=\"background: #7aecec; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n",
       "    Apple\n",
       "    <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">ORG</span>\n",
       "</mark>\n",
       " and Google in \n",
       "<mark class=\"entity\" style=\"background: #ff9561; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n",
       "    Europe\n",
       "    <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">LOC</span>\n",
       "</mark>\n",
       " and \n",
       "<mark class=\"entity\" style=\"background: #aa9cfc; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n",
       "    Donald J. Trump\n",
       "    <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">PERSON</span>\n",
       "</mark>\n",
       "’s broad and often incoherent criticism of the \n",
       "<mark class=\"entity\" style=\"background: #e4e7d2; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n",
       "    Five\n",
       "    <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">CARDINAL</span>\n",
       "</mark>\n",
       " for various alleged misdeeds. </div></span>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<span class=\"tex2jax_ignore\"><div class=\"entities\" style=\"line-height: 2.5; direction: ltr\">\n",
       "<mark class=\"entity\" style=\"background: #7aecec; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n",
       "    Apple\n",
       "    <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">ORG</span>\n",
       "</mark>\n",
       "’s sales were flat \n",
       "<mark class=\"entity\" style=\"background: #bfe1d9; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n",
       "    last year\n",
       "    <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">DATE</span>\n",
       "</mark>\n",
       ", and after a monster \n",
       "<mark class=\"entity\" style=\"background: #bfe1d9; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n",
       "    2016\n",
       "    <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">DATE</span>\n",
       "</mark>\n",
       ", \n",
       "<mark class=\"entity\" style=\"background: #7aecec; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n",
       "    Alphabet’s\n",
       "    <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">ORG</span>\n",
       "</mark>\n",
       " stock price hit a plateau. </div></span>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<span class=\"tex2jax_ignore\"><div class=\"entities\" style=\"line-height: 2.5; direction: ltr\">When \n",
       "<mark class=\"entity\" style=\"background: #7aecec; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n",
       "    Apple\n",
       "    <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">ORG</span>\n",
       "</mark>\n",
       " took on \n",
       "<mark class=\"entity\" style=\"background: #7aecec; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n",
       "    the Federal Bureau of Investigation\n",
       "    <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">ORG</span>\n",
       "</mark>\n",
       " \n",
       "<mark class=\"entity\" style=\"background: #bfe1d9; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n",
       "    last year\n",
       "    <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">DATE</span>\n",
       "</mark>\n",
       " over access to a terrorist’s \n",
       "<mark class=\"entity\" style=\"background: #7aecec; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n",
       "    iPhone\n",
       "    <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">ORG</span>\n",
       "</mark>\n",
       ", many in tech sided with the company, but a majority of \n",
       "<mark class=\"entity\" style=\"background: #c887fb; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n",
       "    Americans\n",
       "    <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">NORP</span>\n",
       "</mark>\n",
       " thought \n",
       "<mark class=\"entity\" style=\"background: #7aecec; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n",
       "    Apple\n",
       "    <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">ORG</span>\n",
       "</mark>\n",
       " should give in. </div></span>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<span class=\"tex2jax_ignore\"><div class=\"entities\" style=\"line-height: 2.5; direction: ltr\">He promised to force \n",
       "<mark class=\"entity\" style=\"background: #7aecec; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n",
       "    Apple\n",
       "    <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">ORG</span>\n",
       "</mark>\n",
       " to make \n",
       "<mark class=\"entity\" style=\"background: #7aecec; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n",
       "    iPhones\n",
       "    <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">ORG</span>\n",
       "</mark>\n",
       " in \n",
       "<mark class=\"entity\" style=\"background: #feca74; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n",
       "    America\n",
       "    <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">GPE</span>\n",
       "</mark>\n",
       ". </div></span>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<span class=\"tex2jax_ignore\"><div class=\"entities\" style=\"line-height: 2.5; direction: ltr\">In a \n",
       "<mark class=\"entity\" style=\"background: #bfe1d9; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n",
       "    2014\n",
       "    <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">DATE</span>\n",
       "</mark>\n",
       " address, now referred to in cybersecurity circles as his “\n",
       "<mark class=\"entity\" style=\"background: #f0d0ff; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n",
       "    Going Dark\n",
       "    <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">WORK_OF_ART</span>\n",
       "</mark>\n",
       "” speech, the F. B. I. ’s director, \n",
       "<mark class=\"entity\" style=\"background: #aa9cfc; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n",
       "    James Comey\n",
       "    <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">PERSON</span>\n",
       "</mark>\n",
       ", argued that the encryption built into \n",
       "<mark class=\"entity\" style=\"background: #7aecec; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n",
       "    Apple\n",
       "    <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">ORG</span>\n",
       "</mark>\n",
       " products posed a threat to public safety  —   enabling not only terrorism but also drug trafficking, child abuse and   . </div></span>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<span class=\"tex2jax_ignore\"><div class=\"entities\" style=\"line-height: 2.5; direction: ltr\">\n",
       "<mark class=\"entity\" style=\"background: #7aecec; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n",
       "    Apple\n",
       "    <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">ORG</span>\n",
       "</mark>\n",
       ", complying with what it said was a request from \n",
       "<mark class=\"entity\" style=\"background: #c887fb; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n",
       "    Chinese\n",
       "    <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">NORP</span>\n",
       "</mark>\n",
       " authorities, removed news apps created by \n",
       "<mark class=\"entity\" style=\"background: #7aecec; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n",
       "    The New York Times\n",
       "    <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">ORG</span>\n",
       "</mark>\n",
       " from its app store in \n",
       "<mark class=\"entity\" style=\"background: #feca74; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n",
       "    China\n",
       "    <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">GPE</span>\n",
       "</mark>\n",
       " \n",
       "<mark class=\"entity\" style=\"background: #bfe1d9; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n",
       "    late last month\n",
       "    <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">DATE</span>\n",
       "</mark>\n",
       ". </div></span>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<span class=\"tex2jax_ignore\"><div class=\"entities\" style=\"line-height: 2.5; direction: ltr\">\n",
       "<mark class=\"entity\" style=\"background: #7aecec; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n",
       "    Apple\n",
       "    <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">ORG</span>\n",
       "</mark>\n",
       " removed both the   and   apps from the app store in \n",
       "<mark class=\"entity\" style=\"background: #feca74; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n",
       "    China\n",
       "    <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">GPE</span>\n",
       "</mark>\n",
       " on \n",
       "<mark class=\"entity\" style=\"background: #bfe1d9; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n",
       "    Dec. 23\n",
       "    <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">DATE</span>\n",
       "</mark>\n",
       ". </div></span>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<span class=\"tex2jax_ignore\"><div class=\"entities\" style=\"line-height: 2.5; direction: ltr\">“For some time now \n",
       "<mark class=\"entity\" style=\"background: #7aecec; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n",
       "    the New York Times\n",
       "    <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">ORG</span>\n",
       "</mark>\n",
       " app has not been permitted to display content to most users in \n",
       "<mark class=\"entity\" style=\"background: #feca74; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n",
       "    China\n",
       "    <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">GPE</span>\n",
       "</mark>\n",
       " and we have been informed that the app is in violation of local regulations,” \n",
       "<mark class=\"entity\" style=\"background: #aa9cfc; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n",
       "    Fred Sainz\n",
       "    <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">PERSON</span>\n",
       "</mark>\n",
       ", an \n",
       "<mark class=\"entity\" style=\"background: #7aecec; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n",
       "    Apple\n",
       "    <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">ORG</span>\n",
       "</mark>\n",
       " spokesman, said of the \n",
       "<mark class=\"entity\" style=\"background: #7aecec; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n",
       "    Times\n",
       "    <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">ORG</span>\n",
       "</mark>\n",
       " apps. </div></span>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<span class=\"tex2jax_ignore\"><div class=\"entities\" style=\"line-height: 2.5; direction: ltr\">Mr. \n",
       "<mark class=\"entity\" style=\"background: #aa9cfc; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n",
       "    Sainz\n",
       "    <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">PERSON</span>\n",
       "</mark>\n",
       " declined to comment on what local regulations the \n",
       "<mark class=\"entity\" style=\"background: #7aecec; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n",
       "    Times\n",
       "    <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">ORG</span>\n",
       "</mark>\n",
       " apps were said to have violated, who had contacted \n",
       "<mark class=\"entity\" style=\"background: #7aecec; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n",
       "    Apple\n",
       "    <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">ORG</span>\n",
       "</mark>\n",
       " and when, and whether a court order or other legal document had been presented. </div></span>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<span class=\"tex2jax_ignore\"><div class=\"entities\" style=\"line-height: 2.5; direction: ltr\">A \n",
       "<mark class=\"entity\" style=\"background: #7aecec; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n",
       "    Times\n",
       "    <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">ORG</span>\n",
       "</mark>\n",
       " spokeswoman in \n",
       "<mark class=\"entity\" style=\"background: #feca74; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n",
       "    New York\n",
       "    <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">GPE</span>\n",
       "</mark>\n",
       ", \n",
       "<mark class=\"entity\" style=\"background: #aa9cfc; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n",
       "    Eileen Murphy\n",
       "    <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">PERSON</span>\n",
       "</mark>\n",
       ", said the company had asked \n",
       "<mark class=\"entity\" style=\"background: #7aecec; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n",
       "    Apple\n",
       "    <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">ORG</span>\n",
       "</mark>\n",
       " to reconsider its decision. </div></span>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<span class=\"tex2jax_ignore\"><div class=\"entities\" style=\"line-height: 2.5; direction: ltr\">\n",
       "<mark class=\"entity\" style=\"background: #7aecec; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n",
       "    Apple\n",
       "    <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">ORG</span>\n",
       "</mark>\n",
       " has previously removed other, less prominent media apps from its \n",
       "<mark class=\"entity\" style=\"background: #feca74; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n",
       "    China\n",
       "    <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">GPE</span>\n",
       "</mark>\n",
       " store. </div></span>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<span class=\"tex2jax_ignore\"><div class=\"entities\" style=\"line-height: 2.5; direction: ltr\">\n",
       "<mark class=\"entity\" style=\"background: #7aecec; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n",
       "    Apple\n",
       "    <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">ORG</span>\n",
       "</mark>\n",
       "’s chief executive, \n",
       "<mark class=\"entity\" style=\"background: #aa9cfc; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n",
       "    Timothy D. Cook\n",
       "    <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">PERSON</span>\n",
       "</mark>\n",
       ", has said that the company complies with all local laws. </div></span>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<span class=\"tex2jax_ignore\"><div class=\"entities\" style=\"line-height: 2.5; direction: ltr\">While in early \n",
       "<mark class=\"entity\" style=\"background: #bfe1d9; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n",
       "    2016\n",
       "    <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">DATE</span>\n",
       "</mark>\n",
       " \n",
       "<mark class=\"entity\" style=\"background: #7aecec; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n",
       "    Apple\n",
       "    <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">ORG</span>\n",
       "</mark>\n",
       " resisted a court request in \n",
       "<mark class=\"entity\" style=\"background: #feca74; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n",
       "    the United States\n",
       "    <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">GPE</span>\n",
       "</mark>\n",
       " for it to help federal officials unlock an \n",
       "<mark class=\"entity\" style=\"background: #7aecec; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n",
       "    iPhone\n",
       "    <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">ORG</span>\n",
       "</mark>\n",
       " for a criminal investigation, Mr. \n",
       "<mark class=\"entity\" style=\"background: #aa9cfc; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n",
       "    Cook\n",
       "    <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">PERSON</span>\n",
       "</mark>\n",
       " said he would obey whatever order the court ultimately handed down. </div></span>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<span class=\"tex2jax_ignore\"><div class=\"entities\" style=\"line-height: 2.5; direction: ltr\">In the end, the government was able to unlock the device without \n",
       "<mark class=\"entity\" style=\"background: #7aecec; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n",
       "    Apple\n",
       "    <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">ORG</span>\n",
       "</mark>\n",
       "’’s help and the case was dropped. </div></span>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<span class=\"tex2jax_ignore\"><div class=\"entities\" style=\"line-height: 2.5; direction: ltr\">\n",
       "<mark class=\"entity\" style=\"background: #aa9cfc; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n",
       "    Farzana Aslam\n",
       "    <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">PERSON</span>\n",
       "</mark>\n",
       ", associate director of \n",
       "<mark class=\"entity\" style=\"background: #7aecec; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n",
       "    the Center for Comparative and Public Law\n",
       "    <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">ORG</span>\n",
       "</mark>\n",
       " at \n",
       "<mark class=\"entity\" style=\"background: #7aecec; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n",
       "    the University of Hong Kong\n",
       "    <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">ORG</span>\n",
       "</mark>\n",
       ", noted that in matters involving customer privacy, \n",
       "<mark class=\"entity\" style=\"background: #7aecec; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n",
       "    Apple\n",
       "    <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">ORG</span>\n",
       "</mark>\n",
       " requires governments to submit subpoenas, search warrants or other legal documents. </div></span>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<span class=\"tex2jax_ignore\"><div class=\"entities\" style=\"line-height: 2.5; direction: ltr\">She added that it was “very worrying” that \n",
       "<mark class=\"entity\" style=\"background: #7aecec; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n",
       "    Apple\n",
       "    <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">ORG</span>\n",
       "</mark>\n",
       " had not disclosed what laws the authorities said were violated, making it difficult for The \n",
       "<mark class=\"entity\" style=\"background: #7aecec; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n",
       "    Times\n",
       "    <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">ORG</span>\n",
       "</mark>\n",
       " and other publishers to file an appeal or challenge the government’s requests. </div></span>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<span class=\"tex2jax_ignore\"><div class=\"entities\" style=\"line-height: 2.5; direction: ltr\">\n",
       "<mark class=\"entity\" style=\"background: #feca74; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n",
       "    China\n",
       "    <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">GPE</span>\n",
       "</mark>\n",
       " is also \n",
       "<mark class=\"entity\" style=\"background: #e4e7d2; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n",
       "    one\n",
       "    <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">CARDINAL</span>\n",
       "</mark>\n",
       " of \n",
       "<mark class=\"entity\" style=\"background: #7aecec; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n",
       "    Apple\n",
       "    <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">ORG</span>\n",
       "</mark>\n",
       "’s largest \n",
       "<mark class=\"entity\" style=\"background: #7aecec; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n",
       "    iPhone\n",
       "    <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">ORG</span>\n",
       "</mark>\n",
       " markets, though sales in that region have slowed. </div></span>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<span class=\"tex2jax_ignore\"><div class=\"entities\" style=\"line-height: 2.5; direction: ltr\">On \n",
       "<mark class=\"entity\" style=\"background: #bfe1d9; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n",
       "    Dec. 23\n",
       "    <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">DATE</span>\n",
       "</mark>\n",
       ", \n",
       "<mark class=\"entity\" style=\"background: #aa9cfc; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n",
       "    David Barboza\n",
       "    <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">PERSON</span>\n",
       "</mark>\n",
       ", a \n",
       "<mark class=\"entity\" style=\"background: #7aecec; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n",
       "    Times\n",
       "    <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">ORG</span>\n",
       "</mark>\n",
       " reporter, spoke with members of \n",
       "<mark class=\"entity\" style=\"background: #7aecec; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n",
       "    Apple\n",
       "    <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">ORG</span>\n",
       "</mark>\n",
       "’s media team about the article. </div></span>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<span class=\"tex2jax_ignore\"><div class=\"entities\" style=\"line-height: 2.5; direction: ltr\">\n",
       "<mark class=\"entity\" style=\"background: #bfe1d9; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n",
       "    Later that day\n",
       "    <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">DATE</span>\n",
       "</mark>\n",
       ", a separate team from \n",
       "<mark class=\"entity\" style=\"background: #7aecec; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n",
       "    Apple\n",
       "    <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">ORG</span>\n",
       "</mark>\n",
       " informed The \n",
       "<mark class=\"entity\" style=\"background: #7aecec; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n",
       "    Times\n",
       "    <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">ORG</span>\n",
       "</mark>\n",
       " that the apps would be removed, Ms. \n",
       "<mark class=\"entity\" style=\"background: #aa9cfc; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n",
       "    Murphy\n",
       "    <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">PERSON</span>\n",
       "</mark>\n",
       " said. </div></span>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<span class=\"tex2jax_ignore\"><div class=\"entities\" style=\"line-height: 2.5; direction: ltr\">The \n",
       "<mark class=\"entity\" style=\"background: #7aecec; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n",
       "    Times\n",
       "    <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">ORG</span>\n",
       "</mark>\n",
       " news apps remain available in \n",
       "<mark class=\"entity\" style=\"background: #7aecec; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n",
       "    Apple\n",
       "    <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">ORG</span>\n",
       "</mark>\n",
       "’s app stores for other countries, as well as the \n",
       "<mark class=\"entity\" style=\"background: #feca74; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n",
       "    Hong Kong\n",
       "    <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">GPE</span>\n",
       "</mark>\n",
       " and \n",
       "<mark class=\"entity\" style=\"background: #feca74; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n",
       "    Taiwan\n",
       "    <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">GPE</span>\n",
       "</mark>\n",
       " stores, but people must have a credit card with a billing address outside mainland \n",
       "<mark class=\"entity\" style=\"background: #feca74; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n",
       "    China\n",
       "    <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">GPE</span>\n",
       "</mark>\n",
       " to download them. </div></span>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<span class=\"tex2jax_ignore\"><div class=\"entities\" style=\"line-height: 2.5; direction: ltr\">\n",
       "<mark class=\"entity\" style=\"background: #7aecec; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n",
       "    Apple\n",
       "    <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">ORG</span>\n",
       "</mark>\n",
       "’s decision to remove the app from its \n",
       "<mark class=\"entity\" style=\"background: #feca74; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n",
       "    China\n",
       "    <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">GPE</span>\n",
       "</mark>\n",
       " store should not affect those who have already installed it. </div></span>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<span class=\"tex2jax_ignore\"><div class=\"entities\" style=\"line-height: 2.5; direction: ltr\">Mr. \n",
       "<mark class=\"entity\" style=\"background: #aa9cfc; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n",
       "    Natkin\n",
       "    <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">PERSON</span>\n",
       "</mark>\n",
       " said that \n",
       "<mark class=\"entity\" style=\"background: #7aecec; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n",
       "    Apple\n",
       "    <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">ORG</span>\n",
       "</mark>\n",
       " had a certain amount of leverage against the \n",
       "<mark class=\"entity\" style=\"background: #c887fb; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n",
       "    Chinese\n",
       "    <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">NORP</span>\n",
       "</mark>\n",
       " government in terms of the total amount of jobs created but that “the technology gap has started to close. ”</div></span>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "def visualize_given_ent_type(processed_docs, entity, ent_type):\n",
    "    \"\"\"\n",
    "    Visualizes named entity annotations in sentences containing a given named entity of a specific type.\n",
    "\n",
    "    Args:\n",
    "        processed_docs (list): A list of processed documents. Each document is a spacy.tokens.Doc object.\n",
    "        entity (str): The named entity to search for.\n",
    "        ent_type (str): The type of the named entity (e.g. 'ORG', 'PERSON', 'GPE')\n",
    "\n",
    "    Returns:\n",
    "        None. Displays inline the named entity annotations for sentences containing the specified entity.\n",
    "    \"\"\"\n",
    "    for doc in processed_docs:\n",
    "        for sentence in doc.sents:\n",
    "            if entity in [ent.text for ent in sentence.ents if ent.label_ == ent_type ]:\n",
    "                displacy.render(sentence, style='ent' )\n",
    "\n",
    "visualize_given_ent_type(processed_docs, 'Apple', 'ORG' )"
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Now - Find sentences where the particular named entity is used alongside other entities of the same type - i.e. a specific entity type is used a particular number of times"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "4"
      ]
     },
     "execution_count": 32,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "def return_count_of_ent_type(sentence, ent_type):\n",
    "    return len([ent.text for ent in sentence.ents if ent.label_ == ent_type ])\n",
    "\n",
    "txt = \"Last week, Democratic lawmakers from both parties said they had the Senate votes needed to pass legislation that would prevent tech platforms, including Apple, GM and Facebook, from favoring their own businesses.\"\n",
    "\n",
    "doc = nlp(txt)\n",
    "\n",
    "return_count_of_ent_type(doc, 'ORG')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 35,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "16\n"
     ]
    }
   ],
   "source": [
    "def return_docs_of_given_ent_type_custom(processed_docs, entity, ent_type):\n",
    "    \"\"\"\n",
    "    Returns sentences containing a given named entity of a specific type, \n",
    "    but only if there is more than one occurrence of the entity type in the sentence.\n",
    "\n",
    "    Args:\n",
    "        processed_docs (list): A list of processed documents. Each document is a spacy.tokens.Doc object.\n",
    "        entity (str): The named entity to search for.\n",
    "        ent_type (str): The type of the named entity (e.g. 'ORG', 'PERSON', 'GPE')\n",
    "\n",
    "    Returns:\n",
    "        output_sentences (list): A list of sentences that contain the specified entity \n",
    "                                 and have more than one occurrence of the specified entity type.\n",
    "    \"\"\"\n",
    "    output_sentences = []\n",
    "    for doc in processed_docs:\n",
    "        for sentence in doc.sents:\n",
    "            if entity in [ent.text for ent in sentence.ents if ent.label_ == ent_type and\n",
    "                          return_count_of_ent_type(sentence, ent_type) > 1 ]:\n",
    "                output_sentences.append(sentence)\n",
    "    return output_sentences\n",
    "\n",
    "output_sentences = return_docs_of_given_ent_type_custom(processed_docs, \"Apple\", \"ORG\")\n",
    "\n",
    "print(len(output_sentences))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 47,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<span class=\"tex2jax_ignore\"><div class=\"entities\" style=\"line-height: 2.5; direction: ltr\">American tech giants like \n",
       "<mark class=\"entity\" style=\"background: linear-gradient(90deg, #64B5F6, #E0F7FA); padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n",
       "    Google\n",
       "    <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">ORG</span>\n",
       "</mark>\n",
       ", \n",
       "<mark class=\"entity\" style=\"background: linear-gradient(90deg, #64B5F6, #E0F7FA); padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n",
       "    Apple\n",
       "    <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">ORG</span>\n",
       "</mark>\n",
       " and Facebook are on a collision course with European regulators over issues including privacy and taxes. </div></span>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<span class=\"tex2jax_ignore\"><div class=\"entities\" style=\"line-height: 2.5; direction: ltr\">Nearly a year ago, I argued that we were witnessing a new era in the tech business, one that is typified less by the storied   in a garage than by a posse I like to call the Frightful Five: \n",
       "<mark class=\"entity\" style=\"background: linear-gradient(90deg, #64B5F6, #E0F7FA); padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n",
       "    Amazon\n",
       "    <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">ORG</span>\n",
       "</mark>\n",
       ", \n",
       "<mark class=\"entity\" style=\"background: linear-gradient(90deg, #64B5F6, #E0F7FA); padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n",
       "    Apple\n",
       "    <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">ORG</span>\n",
       "</mark>\n",
       ", \n",
       "<mark class=\"entity\" style=\"background: linear-gradient(90deg, #64B5F6, #E0F7FA); padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n",
       "    Facebook\n",
       "    <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">ORG</span>\n",
       "</mark>\n",
       ", \n",
       "<mark class=\"entity\" style=\"background: linear-gradient(90deg, #64B5F6, #E0F7FA); padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n",
       "    Microsoft\n",
       "    <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">ORG</span>\n",
       "</mark>\n",
       " and \n",
       "<mark class=\"entity\" style=\"background: linear-gradient(90deg, #64B5F6, #E0F7FA); padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n",
       "    Alphabet, Google’s\n",
       "    <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">ORG</span>\n",
       "</mark>\n",
       " parent company. </div></span>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<span class=\"tex2jax_ignore\"><div class=\"entities\" style=\"line-height: 2.5; direction: ltr\">\n",
       "<mark class=\"entity\" style=\"background: linear-gradient(90deg, #64B5F6, #E0F7FA); padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n",
       "    Apple\n",
       "    <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">ORG</span>\n",
       "</mark>\n",
       "’s sales were flat last year, and after a monster 2016, \n",
       "<mark class=\"entity\" style=\"background: linear-gradient(90deg, #64B5F6, #E0F7FA); padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n",
       "    Alphabet’s\n",
       "    <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">ORG</span>\n",
       "</mark>\n",
       " stock price hit a plateau. </div></span>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<span class=\"tex2jax_ignore\"><div class=\"entities\" style=\"line-height: 2.5; direction: ltr\">When \n",
       "<mark class=\"entity\" style=\"background: linear-gradient(90deg, #64B5F6, #E0F7FA); padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n",
       "    Apple\n",
       "    <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">ORG</span>\n",
       "</mark>\n",
       " took on \n",
       "<mark class=\"entity\" style=\"background: linear-gradient(90deg, #64B5F6, #E0F7FA); padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n",
       "    the Federal Bureau of Investigation\n",
       "    <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">ORG</span>\n",
       "</mark>\n",
       " last year over access to a terrorist’s \n",
       "<mark class=\"entity\" style=\"background: linear-gradient(90deg, #64B5F6, #E0F7FA); padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n",
       "    iPhone\n",
       "    <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">ORG</span>\n",
       "</mark>\n",
       ", many in tech sided with the company, but a majority of Americans thought \n",
       "<mark class=\"entity\" style=\"background: linear-gradient(90deg, #64B5F6, #E0F7FA); padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n",
       "    Apple\n",
       "    <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">ORG</span>\n",
       "</mark>\n",
       " should give in. </div></span>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<span class=\"tex2jax_ignore\"><div class=\"entities\" style=\"line-height: 2.5; direction: ltr\">He promised to force \n",
       "<mark class=\"entity\" style=\"background: linear-gradient(90deg, #64B5F6, #E0F7FA); padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n",
       "    Apple\n",
       "    <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">ORG</span>\n",
       "</mark>\n",
       " to make \n",
       "<mark class=\"entity\" style=\"background: linear-gradient(90deg, #64B5F6, #E0F7FA); padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n",
       "    iPhones\n",
       "    <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">ORG</span>\n",
       "</mark>\n",
       " in America. </div></span>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<span class=\"tex2jax_ignore\"><div class=\"entities\" style=\"line-height: 2.5; direction: ltr\">\n",
       "<mark class=\"entity\" style=\"background: linear-gradient(90deg, #64B5F6, #E0F7FA); padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n",
       "    Apple\n",
       "    <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">ORG</span>\n",
       "</mark>\n",
       ", complying with what it said was a request from Chinese authorities, removed news apps created by \n",
       "<mark class=\"entity\" style=\"background: linear-gradient(90deg, #64B5F6, #E0F7FA); padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n",
       "    The New York Times\n",
       "    <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">ORG</span>\n",
       "</mark>\n",
       " from its app store in China late last month. </div></span>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<span class=\"tex2jax_ignore\"><div class=\"entities\" style=\"line-height: 2.5; direction: ltr\">“For some time now \n",
       "<mark class=\"entity\" style=\"background: linear-gradient(90deg, #64B5F6, #E0F7FA); padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n",
       "    the New York Times\n",
       "    <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">ORG</span>\n",
       "</mark>\n",
       " app has not been permitted to display content to most users in China and we have been informed that the app is in violation of local regulations,” Fred Sainz, an \n",
       "<mark class=\"entity\" style=\"background: linear-gradient(90deg, #64B5F6, #E0F7FA); padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n",
       "    Apple\n",
       "    <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">ORG</span>\n",
       "</mark>\n",
       " spokesman, said of the \n",
       "<mark class=\"entity\" style=\"background: linear-gradient(90deg, #64B5F6, #E0F7FA); padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n",
       "    Times\n",
       "    <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">ORG</span>\n",
       "</mark>\n",
       " apps. </div></span>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<span class=\"tex2jax_ignore\"><div class=\"entities\" style=\"line-height: 2.5; direction: ltr\">Mr. Sainz declined to comment on what local regulations the \n",
       "<mark class=\"entity\" style=\"background: linear-gradient(90deg, #64B5F6, #E0F7FA); padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n",
       "    Times\n",
       "    <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">ORG</span>\n",
       "</mark>\n",
       " apps were said to have violated, who had contacted \n",
       "<mark class=\"entity\" style=\"background: linear-gradient(90deg, #64B5F6, #E0F7FA); padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n",
       "    Apple\n",
       "    <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">ORG</span>\n",
       "</mark>\n",
       " and when, and whether a court order or other legal document had been presented. </div></span>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<span class=\"tex2jax_ignore\"><div class=\"entities\" style=\"line-height: 2.5; direction: ltr\">A \n",
       "<mark class=\"entity\" style=\"background: linear-gradient(90deg, #64B5F6, #E0F7FA); padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n",
       "    Times\n",
       "    <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">ORG</span>\n",
       "</mark>\n",
       " spokeswoman in New York, Eileen Murphy, said the company had asked \n",
       "<mark class=\"entity\" style=\"background: linear-gradient(90deg, #64B5F6, #E0F7FA); padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n",
       "    Apple\n",
       "    <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">ORG</span>\n",
       "</mark>\n",
       " to reconsider its decision. </div></span>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<span class=\"tex2jax_ignore\"><div class=\"entities\" style=\"line-height: 2.5; direction: ltr\">While in early 2016 \n",
       "<mark class=\"entity\" style=\"background: linear-gradient(90deg, #64B5F6, #E0F7FA); padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n",
       "    Apple\n",
       "    <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">ORG</span>\n",
       "</mark>\n",
       " resisted a court request in the United States for it to help federal officials unlock an \n",
       "<mark class=\"entity\" style=\"background: linear-gradient(90deg, #64B5F6, #E0F7FA); padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n",
       "    iPhone\n",
       "    <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">ORG</span>\n",
       "</mark>\n",
       " for a criminal investigation, Mr. Cook said he would obey whatever order the court ultimately handed down. </div></span>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<span class=\"tex2jax_ignore\"><div class=\"entities\" style=\"line-height: 2.5; direction: ltr\">Farzana Aslam, associate director of \n",
       "<mark class=\"entity\" style=\"background: linear-gradient(90deg, #64B5F6, #E0F7FA); padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n",
       "    the Center for Comparative and Public Law\n",
       "    <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">ORG</span>\n",
       "</mark>\n",
       " at \n",
       "<mark class=\"entity\" style=\"background: linear-gradient(90deg, #64B5F6, #E0F7FA); padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n",
       "    the University of Hong Kong\n",
       "    <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">ORG</span>\n",
       "</mark>\n",
       ", noted that in matters involving customer privacy, \n",
       "<mark class=\"entity\" style=\"background: linear-gradient(90deg, #64B5F6, #E0F7FA); padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n",
       "    Apple\n",
       "    <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">ORG</span>\n",
       "</mark>\n",
       " requires governments to submit subpoenas, search warrants or other legal documents. </div></span>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<span class=\"tex2jax_ignore\"><div class=\"entities\" style=\"line-height: 2.5; direction: ltr\">She added that it was “very worrying” that \n",
       "<mark class=\"entity\" style=\"background: linear-gradient(90deg, #64B5F6, #E0F7FA); padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n",
       "    Apple\n",
       "    <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">ORG</span>\n",
       "</mark>\n",
       " had not disclosed what laws the authorities said were violated, making it difficult for The \n",
       "<mark class=\"entity\" style=\"background: linear-gradient(90deg, #64B5F6, #E0F7FA); padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n",
       "    Times\n",
       "    <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">ORG</span>\n",
       "</mark>\n",
       " and other publishers to file an appeal or challenge the government’s requests. </div></span>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<span class=\"tex2jax_ignore\"><div class=\"entities\" style=\"line-height: 2.5; direction: ltr\">China is also one of \n",
       "<mark class=\"entity\" style=\"background: linear-gradient(90deg, #64B5F6, #E0F7FA); padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n",
       "    Apple\n",
       "    <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">ORG</span>\n",
       "</mark>\n",
       "’s largest \n",
       "<mark class=\"entity\" style=\"background: linear-gradient(90deg, #64B5F6, #E0F7FA); padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n",
       "    iPhone\n",
       "    <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">ORG</span>\n",
       "</mark>\n",
       " markets, though sales in that region have slowed. </div></span>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<span class=\"tex2jax_ignore\"><div class=\"entities\" style=\"line-height: 2.5; direction: ltr\">On Dec. 23, David Barboza, a \n",
       "<mark class=\"entity\" style=\"background: linear-gradient(90deg, #64B5F6, #E0F7FA); padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n",
       "    Times\n",
       "    <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">ORG</span>\n",
       "</mark>\n",
       " reporter, spoke with members of \n",
       "<mark class=\"entity\" style=\"background: linear-gradient(90deg, #64B5F6, #E0F7FA); padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n",
       "    Apple\n",
       "    <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">ORG</span>\n",
       "</mark>\n",
       "’s media team about the article. </div></span>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<span class=\"tex2jax_ignore\"><div class=\"entities\" style=\"line-height: 2.5; direction: ltr\">Later that day, a separate team from \n",
       "<mark class=\"entity\" style=\"background: linear-gradient(90deg, #64B5F6, #E0F7FA); padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n",
       "    Apple\n",
       "    <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">ORG</span>\n",
       "</mark>\n",
       " informed The \n",
       "<mark class=\"entity\" style=\"background: linear-gradient(90deg, #64B5F6, #E0F7FA); padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n",
       "    Times\n",
       "    <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">ORG</span>\n",
       "</mark>\n",
       " that the apps would be removed, Ms. Murphy said. </div></span>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<span class=\"tex2jax_ignore\"><div class=\"entities\" style=\"line-height: 2.5; direction: ltr\">The \n",
       "<mark class=\"entity\" style=\"background: linear-gradient(90deg, #64B5F6, #E0F7FA); padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n",
       "    Times\n",
       "    <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">ORG</span>\n",
       "</mark>\n",
       " news apps remain available in \n",
       "<mark class=\"entity\" style=\"background: linear-gradient(90deg, #64B5F6, #E0F7FA); padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n",
       "    Apple\n",
       "    <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">ORG</span>\n",
       "</mark>\n",
       "’s app stores for other countries, as well as the Hong Kong and Taiwan stores, but people must have a credit card with a billing address outside mainland China to download them. </div></span>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "def visualize_conditional_sentences(sentences):\n",
    "    \"\"\"\n",
    "    This function visualizes the named entities in the given sentences using the displaCy visualizer from SpaCy.\n",
    "    It specifically highlights organizations (ORG) in the sentences.\n",
    "\n",
    "    Parameters:\n",
    "    sentences (list): A list of sentences. Each sentence is expected to be a SpaCy Doc object with named entities.\n",
    "\n",
    "    Returns:\n",
    "    None. The function directly renders the visualization in the Jupyter notebook or other environment.\n",
    "    \"\"\"\n",
    "    colors = {\"ORG\": \"linear-gradient(90deg, #64B5F6, #E0F7FA)\"}\n",
    "    options = {\"ents\": [\"ORG\"], \"colors\": colors}\n",
    "    \n",
    "    for sentence in sentences:\n",
    "        displacy.render(sentence, style=\"ent\", options=options)\n",
    "        \n",
    "\n",
    "\n",
    "visualize_conditional_sentences(output_sentences )\n",
    "    "
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3.9.13 64-bit",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.13"
  },
  "orig_nbformat": 4,
  "vscode": {
   "interpreter": {
    "hash": "36cf16204b8548560b1c020c4e8fb5b57f0e4c58016f52f2d4be01e192833930"
   }
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
